Skip to content

Commit

Permalink
cudart
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed Jun 23, 2024
1 parent 69e5cd2 commit 7222e57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ target_compile_features(driver PUBLIC cxx_std_14)
install(TARGETS driver LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME})

pybind11_add_module(cpu_driver "src/exoplanet_core/jax/cpu_driver.cpp")
target_include_directories(cpu_driver PRIVATE "src/exoplanet_core/jax")
target_include_directories(cpu_driver PUBLIC "src/exoplanet_core/jax")
target_compile_features(cpu_driver PUBLIC cxx_std_14)
install(TARGETS cpu_driver LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME}/jax)

if ("$ENV{EXOPLANET_CORE_CUDA}" STREQUAL "yes")
enable_language(CUDA)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
find_package(CUDAToolkit REQUIRED)
pybind11_add_module(
gpu_driver
"src/exoplanet_core/jax/cuda_kernels.cc.cu"
"src/exoplanet_core/jax/gpu_driver.cpp")
target_include_directories(gpu_driver PUBLIC $<TARGET_PROPERTY:CUDA::cudart,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_features(gpu_driver PUBLIC cxx_std_14)
install(TARGETS gpu_driver LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME}/jax)
endif()

0 comments on commit 7222e57

Please sign in to comment.