Skip to content

Commit

Permalink
Add comment explaining why bootstrapping cuda is now a two-step proce…
Browse files Browse the repository at this point in the history
…ss [no ci]
  • Loading branch information
dagardner-nv committed Jan 17, 2024
1 parent 5015467 commit cc5d39a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ morpheus_utils_initialize_package_manager(
)

# Initialize CUDA
# NOTE: This MUST occur before any 'project' calls because of rapids_cmake requirements.
# This is a two-step process. We need to call morpheus_utils_initialize_cuda_arch which in turn calls
# rapids_cuda_init_architectures prior to calling project(). This is because rapids_cuda_init_architectures defines a
# `CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` hook which is invoked by the project() call. This hook is what allows us to
# set `CMAKE_CUDA_ARCHITECTURES=rapids` when performing a release build which will be expanded to the current list of
# supported architectures by our version of rapids.
#
# After the call to project() we can then call morpheus_utils_enable_cuda() which will set some CUDA+clang settings
# which can only be performed after calling project(), but which must be set prior to calling enable_language(CUDA)
if(DEFINED MORPHEUS_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES "${MORPHEUS_CUDA_ARCHITECTURES}")
endif()
Expand All @@ -89,7 +96,7 @@ project(morpheus
LANGUAGES C CXX
)

# Configure CUDA architecture
# This sets some clang specific settings for CUDA prior to calling enable_language(CUDA)
morpheus_utils_enable_cuda()

rapids_cmake_write_version_file(${CMAKE_BINARY_DIR}/autogenerated/include/morpheus/version.hpp)
Expand Down

0 comments on commit cc5d39a

Please sign in to comment.