Skip to content

Commit f7799bf

Browse files
committed
Add CUDA back toCMakeLists.txt
1 parent 91ef0d1 commit f7799bf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

CMakeLists.txt

+24
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,30 @@ endif()
211211
# Use C++17
212212
target_compile_features(ipc_toolkit PUBLIC cxx_std_17)
213213

214+
################################################################################
215+
# CUDA
216+
################################################################################
217+
218+
if(IPC_TOOLKIT_WITH_CUDA)
219+
include(CheckLanguage)
220+
check_language(CUDA)
221+
222+
if(CMAKE_CUDA_COMPILER)
223+
enable_language(CUDA)
224+
else()
225+
message(FATAL_ERROR "No CUDA support found!")
226+
endif()
227+
228+
# We need to explicitly state that we need all CUDA files in the particle
229+
# library to be built with -dc as the member functions could be called by
230+
# other libraries and executables.
231+
set_target_properties(ipc_toolkit PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
232+
233+
# Use the same CUDA architectures Scalable CCD
234+
get_target_property(CMAKE_CUDA_ARCHITECTURES scalable_ccd CUDA_ARCHITECTURES)
235+
set_target_properties(ipc_toolkit PROPERTIES CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
236+
endif()
237+
214238
################################################################################
215239
# Tests
216240
################################################################################

0 commit comments

Comments
 (0)