Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions cmake/therock_subproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,21 @@ get_property(existing_packages GLOBAL PROPERTY THEROCK_ALL_PROVIDED_PACKAGES)
endif()
endfunction()

# therock_cmake_subproject_require_program
# Requires that find_program finds a named program at super-project configure time.
# This is to avoid downstream errors that would otherwise only show up at build time.
# Only to be used by programs that must exist on the host in order to build. Programs
# that are built as part of the project are resolved internally.
function(therock_cmake_subproject_require_host_program target_name)
_therock_assert_is_cmake_subproject("${target_name}")
foreach(prog IN LISTS ARGN)
find_program(found "${prog}" OPTIONAL)
if(NOT found)
message(FATAL_ERROR "Building sub-project ${target_name} requires program '${prog}' on the system path but it is not found")
endif()
endforeach()
endfunction()

# therock_cmake_subproject_activate
# If using multi-step setup (i.e. without 'ACTIVATE' on the declare), then this
# must be called once all configuration is complete.
Expand Down
10 changes: 10 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
)
endif()

# Conditional rocm-kpack support for kpack split artifacts
set(_hip_clr_kpack_runtime_deps)
set(_hip_clr_kpack_cmake_args)
if(THEROCK_KPACK_SPLIT_ARTIFACTS)
list(APPEND _hip_clr_kpack_runtime_deps rocm-kpack)
list(APPEND _hip_clr_kpack_cmake_args "-DROCM_KPACK_ENABLED=ON")
endif()
Comment on lines +116 to +122
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could use consistent variable casing here, or append to the existing HIP_CLR_CMAKE_ARGS and HIP_CLR_RUNTIME_DEPS variables instread of introducing new variables

see below where both variables are used:

      ${HIP_CLR_CMAKE_ARGS}
      ${_hip_clr_kpack_cmake_args}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll normalize in a follow-up. Easier on my branches to fix on the upstream integration branch and save a CI cycle.


therock_cmake_subproject_declare(hip-clr
USE_DIST_AMDGPU_TARGETS
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/clr"
Expand All @@ -130,6 +138,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
# and can use local machine tools.
"-DHIPCC_BIN_DIR="
${HIP_CLR_CMAKE_ARGS}
${_hip_clr_kpack_cmake_args}
BUILD_DEPS
rocm-cmake
therock-simde
Expand All @@ -139,6 +148,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME)
hipcc # For hipconfig
rocm-core
${HIP_CLR_RUNTIME_DEPS}
${_hip_clr_kpack_runtime_deps}
INTERFACE_LINK_DIRS
"lib"
INTERFACE_INSTALL_RPATH_DIRS
Expand Down
1 change: 1 addition & 0 deletions math-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ if(THEROCK_ENABLE_LIBHIPCXX)
SUBDIRS
.
)
therock_cmake_subproject_require_host_program(libhipcxx lit)
therock_cmake_subproject_activate(libhipcxx)

therock_provide_artifact(libhipcxx
Expand Down
Loading