Skip to content

Commit 4db8681

Browse files
committed
Fix kernel inclusion problems in Py installations
1 parent 2a227f0 commit 4db8681

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
2626
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
2727
endif()
2828

29+
# Mark compile time (not runtime), affects how some kernel files include
30+
add_compile_definitions(DEME_BEING_CMAKE_COMPILED)
31+
2932
# ---------------------------------------------------------------------------- #
3033
# Additional Packages
3134
# ---------------------------------------------------------------------------- #

src/algorithms/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ message(STATUS "==== Configuring GPU Algorithm Components ====")
77

88
set (algorithms_message "[algorithms]")
99

10-
11-
1210
add_library(algorithms OBJECT)
1311

1412
target_include_directories(

src/kernel/DEMHelperKernels.cuh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
#define DEME_HELPER_KERNELS_CU
55

66
#include <DEM/Defines.h>
7-
#include <kernel/CUDAMathHelpers.cuh>
7+
8+
// CUDAMathHelpers.cuh is used in static compilation, and that needs to be found through src then kernel. But at
9+
// runtime, we ask jitify to find include files only at same level of all other fellow kernel files.
10+
#ifdef DEME_BEING_CMAKE_COMPILED
11+
#include <kernel/CUDAMathHelpers.cuh>
12+
#else
13+
#include <CUDAMathHelpers.cuh>
14+
#endif
815

916
// inline __device__ voxelID_t position2VoxelID
1017

0 commit comments

Comments
 (0)