Skip to content

Commit

Permalink
cmake: allow multiple CUDA architectures
Browse files Browse the repository at this point in the history
In order to properly specify multiple CUDA architectures, we must quote
the variable so that cmake does not interpret it as multiple arguments
to `set_target_properties`.
  • Loading branch information
janden committed Aug 20, 2024
1 parent cdcccbe commit 565f9a5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target_include_directories(cufinufft_common_objects
set_target_properties(
cufinufft_common_objects
PROPERTIES POSITION_INDEPENDENT_CODE ${FINUFFT_SHARED_LINKING}
CUDA_ARCHITECTURES ${FINUFFT_CUDA_ARCHITECTURES}
CUDA_ARCHITECTURES "${FINUFFT_CUDA_ARCHITECTURES}"
CUDA_SEPARABLE_COMPILATION ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON)
Expand All @@ -60,7 +60,7 @@ target_include_directories(cufinufft_objects PUBLIC ${CUFINUFFT_INCLUDE_DIRS})
set_target_properties(
cufinufft_objects
PROPERTIES POSITION_INDEPENDENT_CODE ${FINUFFT_SHARED_LINKING}
CUDA_ARCHITECTURES ${FINUFFT_CUDA_ARCHITECTURES}
CUDA_ARCHITECTURES "${FINUFFT_CUDA_ARCHITECTURES}"
CUDA_SEPARABLE_COMPILATION ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON)
Expand All @@ -78,12 +78,11 @@ endif()

set_target_properties(
cufinufft
PROPERTIES CUDA_ARCHITECTURES ${FINUFFT_CUDA_ARCHITECTURES}
PROPERTIES CUDA_ARCHITECTURES "${FINUFFT_CUDA_ARCHITECTURES}"
CUDA_SEPARABLE_COMPILATION ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
CUDA_ARCHITECTURES ${FINUFFT_CUDA_ARCHITECTURES})
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
target_compile_features(cufinufft PRIVATE cxx_std_17)

if(WIN32)
Expand Down

0 comments on commit 565f9a5

Please sign in to comment.