Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-10-05 15:53:27 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-10-06 15:21:26 +0300
commit03f8c1abd06e204f5a46046e71f29054a6fc0ed0 (patch)
tree90bcf0728dbffb6324e879e442a8e19a44f96dc7 /intern
parent18c6314e2660820778c555143b234dff3ba35ffa (diff)
Build: add ccache support for CUDA kernels on Linux
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt21
1 files changed, 16 insertions, 5 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 514b7f8263c..c53d3d4b962 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -404,16 +404,27 @@ if(WITH_CYCLES_CUDA_BINARIES)
-cuda-toolkit-dir "${cuda_toolkit_root_dir}"
DEPENDS ${kernel_sources} cycles_cubin_cc)
else()
- add_custom_command(
- OUTPUT ${cuda_file}
- COMMAND ${cuda_nvcc_executable}
+ set(_cuda_nvcc_args
-arch=${arch}
${CUDA_NVCC_FLAGS}
--${format}
${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
--ptxas-options="-v"
- ${cuda_flags}
- DEPENDS ${kernel_sources})
+ ${cuda_flags})
+
+ if(WITH_COMPILER_CCACHE AND CCACHE_PROGRAM)
+ add_custom_command(
+ OUTPUT ${cuda_file}
+ COMMAND ${CCACHE_PROGRAM} ${cuda_nvcc_executable} ${_cuda_nvcc_args}
+ DEPENDS ${kernel_sources})
+ else()
+ add_custom_command(
+ OUTPUT ${cuda_file}
+ COMMAND ${cuda_nvcc_executable} ${_cuda_nvcc_args}
+ DEPENDS ${kernel_sources})
+ endif()
+
+ unset(_cuda_nvcc_args)
endif()
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_file}" ${CYCLES_INSTALL_PATH}/lib)
list(APPEND cuda_cubins ${cuda_file})