Skip to content

Commit c6f7d27

Browse files
authored
Update CMakeLists.txt
1 parent 02188cc commit c6f7d27

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ if(BUILD_CUDA)
161161
string(APPEND CMAKE_CUDA_FLAGS " -Xptxas=-v")
162162
endif()
163163

164+
foreach(capability ${CMAKE_CUDA_ARCHITECTURES_ALL})
165+
# Most of the items here are like: `xx-real`, so we just extract the `xx` portion
166+
string(REGEX MATCH "[0-9]+" capability_id "${capability}")
167+
if(capability_id GREATER 0)
168+
list(APPEND POSSIBLE_CAPABILITIES ${capability_id})
169+
endif()
170+
endforeach()
171+
164172
# This can be changed via -D argument to CMake
165173
# By default all possible capabilities are compiled
166174
set(COMPUTE_CAPABILITY "${POSSIBLE_CAPABILITIES}" CACHE STRING "Compute Capabilities Targeted")

0 commit comments

Comments
 (0)