Skip to content

Commit 69a7541

Browse files
Build only compute for the newest arch in CMAKE_CUDA_ARCHITECTURES (#706)
RMM doesn't need to build `sm` and `compute` for each architecture, but only for the newest arch. Authors: - Robert Maynard (@robertmaynard) Approvers: - Keith Kraus (@kkraus14) - Mark Harris (@harrism) URL: #706
1 parent 4ebf48a commit 69a7541

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/Modules/SetGPUArchs.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ if(CMAKE_CUDA_ARCHITECTURES STREQUAL "")
6666
evaluate_gpu_archs(CMAKE_CUDA_ARCHITECTURES)
6767
endif(CMAKE_CUDA_ARCHITECTURES STREQUAL "")
6868

69+
# CMake architecture list entry of "80" means to build compute and sm. What we want is for the
70+
# newest arch only to build that way while the rest built only for sm.
71+
list(SORT CMAKE_CUDA_ARCHITECTURES ORDER ASCENDING)
72+
list(POP_BACK CMAKE_CUDA_ARCHITECTURES latest_arch)
73+
list(TRANSFORM CMAKE_CUDA_ARCHITECTURES APPEND "-real")
74+
list(APPEND CMAKE_CUDA_ARCHITECTURES ${latest_arch})
75+
6976
set(CMAKE_CUDA_ARCHITECTURES
7077
${CMAKE_CUDA_ARCHITECTURES}
7178
PARENT_SCOPE)

0 commit comments

Comments
 (0)