Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmake/therock_rocprim_benchmark_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT

# Workaround: rocPRIM benchmarks link against amd_smi but the project never
# calls find_package(amd_smi). Without the imported target the include
# directories are not propagated and the build fails with a missing
# <amd_smi/amdsmi.h> header. Injecting the find_package call here via
# CMAKE_INCLUDES ensures the target exists before the benchmark subdirectory
# is processed.
#
# TODO(https://github.com/ROCm/TheRock/issues/4651): Remove once upstream
# rocPRIM adds its own find_package(amd_smi).

if(NOT TARGET amd_smi)
find_package(amd_smi REQUIRED CONFIG)
endif()
15 changes: 15 additions & 0 deletions math-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ if(THEROCK_ENABLE_PRIM)
# rocPRIM_tests declared as a separate target to stop the tests from clogging up the critical build path for libs
# that depend on rocPRIM
# passing BACKGROUND_BUILD ensures that the tests aren't built (too) concurrently with other projects that are demanding
# amdsmi is Linux-only; benchmarks depend on primbench which requires amd_smi
if(WIN32)
set(_rocprim_benchmark_enable "OFF")
set(_rocprim_benchmark_deps)
set(_rocprim_benchmark_includes)
else()
set(_rocprim_benchmark_enable "ON")
set(_rocprim_benchmark_deps amdsmi)
set(_rocprim_benchmark_includes therock_rocprim_benchmark_deps.cmake)
endif()

therock_cmake_subproject_declare(rocPRIM_tests
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_LIBRARIES_SOURCE_DIR}/projects/rocprim"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocPRIM_tests"
Expand All @@ -124,13 +135,17 @@ if(THEROCK_ENABLE_PRIM)
-DROCM_PATH=
-DROCM_DIR=
-DBUILD_TEST=ON
-DBUILD_BENCHMARK=${_rocprim_benchmark_enable}
-DUSE_SYSTEM_LIB=ON
CMAKE_INCLUDES
${_rocprim_benchmark_includes}
COMPILER_TOOLCHAIN
amd-hip
BUILD_DEPS
rocm-cmake
therock-googletest
rocPRIM
${_rocprim_benchmark_deps}
RUNTIME_DEPS
hip-clr
)
Expand Down
Loading