Skip to content

Commit 12ba0e4

Browse files
committed
Merge branch 'main' into ogc
2 parents 7333114 + d2cb640 commit 12ba0e4

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

CMakeLists.txt

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ include(ipc_toolkit_use_colors)
110110
# Generate position-independent code by default
111111
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
112112

113+
################################################################################
114+
# CUDA
115+
################################################################################
116+
117+
if(IPC_TOOLKIT_WITH_CUDA)
118+
# If CMAKE_CUDA_ARCHITECTURES was not specified, set it to native.
119+
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
120+
message(STATUS "CMAKE_CUDA_ARCHITECTURES was specified, skipping auto-detection")
121+
else()
122+
message(STATUS "CMAKE_CUDA_ARCHITECTURES was not specified, set it to native")
123+
set(CMAKE_CUDA_ARCHITECTURES "native")
124+
endif()
125+
message(STATUS "Targeting CUDA_ARCHITECTURES \"${CMAKE_CUDA_ARCHITECTURES}\"")
126+
127+
# Enable CUDA support
128+
enable_language(CUDA)
129+
endif()
130+
113131
################################################################################
114132
# IPC Toolkit Library
115133
################################################################################
@@ -118,6 +136,13 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
118136
add_library(ipc_toolkit)
119137
add_library(ipc::toolkit ALIAS ipc_toolkit)
120138

139+
if(IPC_TOOLKIT_WITH_CUDA)
140+
# We need to explicitly state that we need all CUDA files in the particle
141+
# library to be built with -dc as the member functions could be called by
142+
# other libraries and executables.
143+
set_target_properties(ipc_toolkit PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
144+
endif()
145+
121146
# Fill in configuration options
122147
configure_file(
123148
"${IPC_TOOLKIT_SOURCE_DIR}/config.hpp.in"
@@ -233,29 +258,6 @@ endif()
233258
# Use C++17
234259
target_compile_features(ipc_toolkit PUBLIC cxx_std_17)
235260

236-
################################################################################
237-
# CUDA
238-
################################################################################
239-
240-
if(IPC_TOOLKIT_WITH_CUDA)
241-
# If CMAKE_CUDA_ARCHITECTURES was not specified, set it to native.
242-
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
243-
message(STATUS "CMAKE_CUDA_ARCHITECTURES was specified, skipping auto-detection")
244-
else()
245-
message(STATUS "CMAKE_CUDA_ARCHITECTURES was not specified, set it to native")
246-
set(CMAKE_CUDA_ARCHITECTURES "native")
247-
endif()
248-
message(STATUS "Targeting CUDA_ARCHITECTURES \"${CMAKE_CUDA_ARCHITECTURES}\"")
249-
250-
# Enable CUDA support
251-
enable_language(CUDA)
252-
253-
# We need to explicitly state that we need all CUDA files in the particle
254-
# library to be built with -dc as the member functions could be called by
255-
# other libraries and executables.
256-
set_target_properties(ipc_toolkit PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
257-
endif()
258-
259261
################################################################################
260262
# Tests
261263
################################################################################

src/ipc/broad_phase/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ set(SOURCES
1616
spatial_hash.hpp
1717
sweep_and_prune.cpp
1818
sweep_and_prune.hpp
19-
sweep_and_tiniest_queue.cpp
19+
sweep_and_tiniest_queue.cu
2020
sweep_and_tiniest_queue.hpp
2121
voxel_size_heuristic.cpp
2222
voxel_size_heuristic.hpp
2323
)
2424

25-
target_sources(ipc_toolkit PRIVATE ${SOURCES})
25+
target_sources(ipc_toolkit PRIVATE ${SOURCES})

0 commit comments

Comments
 (0)