Skip to content

Commit

Permalink
Set pybind11_INCLUDE_DIRS correctly for CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Dec 4, 2023
1 parent e7ab84c commit 153247b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pybind_interface/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ INCLUDE(../GetPybind11.cmake)
find_package(PythonLibs 3.7 REQUIRED)
find_package(CUDA REQUIRED)

include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include)
include_directories(${PYTHON_INCLUDE_DIRS})
if(pybind11_FOUND)
include_directories(${pybind11_INCLUDE_DIRS})
else() # means pybind11 has been fetched in GetPybind11.cmake
include_directories(${pybind11_SOURCE_DIR}/include)
endif()

cuda_add_library(qsim_cuda MODULE pybind_main_cuda.cpp)
set_target_properties(qsim_cuda PROPERTIES
CUDA_ARCHITECTURES "all"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
CUDA_ARCHITECTURES "all"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
set_source_files_properties(pybind_main_cuda.cpp PROPERTIES LANGUAGE CUDA)

Expand Down

0 comments on commit 153247b

Please sign in to comment.