diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 3414e4be46..318db4327b 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -77,6 +77,8 @@ if(THEROCK_ENABLE_HIP_RUNTIME) ############################################################################## set(HIP_CLR_CMAKE_ARGS) set(HIP_CLR_RUNTIME_DEPS) + set(_hip_subproject_names) + if(WIN32) # Windows CLR options set(_compute_pal_dir "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/shared/amdgpu-windows-interop") @@ -133,6 +135,31 @@ if(THEROCK_ENABLE_HIP_RUNTIME) therock_cmake_subproject_provide_package(hip-clr hip-lang lib/cmake/hip-lang) therock_cmake_subproject_provide_package(hip-clr hiprtc lib/cmake/hiprtc) therock_cmake_subproject_activate(hip-clr) + list(APPEND _hip_subproject_names hip-clr) + + if(THEROCK_BUILD_TESTING) + therock_cmake_subproject_declare(hip-tests + USE_DIST_AMDGPU_TARGETS + EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/hip-tests" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/hip-tests" + CMAKE_LISTS_RELPATH "catch" + LOGICAL_TARGET_NAME build_tests + BACKGROUND_BUILD + CMAKE_ARGS + "-DHIP_PLATFORM=amd" + "-DROCM_PATH=" + COMPILER_TOOLCHAIN + amd-hip + BUILD_DEPS + rocm-cmake + therock-catch2 + RUNTIME_DEPS + hip-clr + ) + therock_cmake_subproject_glob_c_sources(hip-tests SUBDIRS .) + therock_cmake_subproject_activate(hip-tests) + list(APPEND _hip_subproject_names hip-tests) + endif(THEROCK_BUILD_TESTING) therock_provide_artifact(core-hip TARGET_NEUTRAL @@ -144,7 +171,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME) lib run SUBPROJECT_DEPS - hip-clr + ${_hip_subproject_names} ) therock_test_validate_shared_lib( @@ -154,6 +181,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME) libhiprtc-builtins.so libhiprtc.so ) + if(WIN32) ############################################################################## # hipInfo (from hip-tests) diff --git a/core/artifact-core-hip.toml b/core/artifact-core-hip.toml index 2fe8d9e527..a96891dfb4 100644 --- a/core/artifact-core-hip.toml +++ b/core/artifact-core-hip.toml @@ -11,3 +11,12 @@ include = [ include = [ "bin/**", ] + +# hip-tests +[components.doc."core/hip-tests/stage"] +optional = true +[components.test."core/hip-tests/stage"] +include = [ + "share/hip/**", +] +optional = true