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
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/CMakeLists.txt')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 3a06aecdfcf..614391bd3f2 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -83,6 +83,32 @@ set(SRC_UTIL_HEADERS
../util/util_transform.h
../util/util_types.h
)
+# CUDA module
+
+if(WITH_CYCLES_CUDA_BINARIES)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(CUDA_BITS 64)
+ else()
+ set(CUDA_BITS 32)
+ endif()
+
+ set(cuda_sources kernel.cu ${headers} ${svm_headers})
+ set(cuda_cubins)
+
+ foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
+ set(cuda_cubin kernel_${arch}.cubin)
+
+ add_custom_command(
+ OUTPUT ${cuda_cubin}
+ COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" --maxrregcount=24 --opencc-options -OPT:Olimit=0 -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
+ DEPENDS ${cuda_sources})
+
+ delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
+ list(APPEND cuda_cubins ${cuda_cubin})
+ endforeach()
+
+ add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
+endif()
# OSL module