163aacf19f9c8f010717af70ef34208c266bfa32
[blender.git] / intern / cycles / kernel / CMakeLists.txt
1 remove_extra_strict_flags()
2
3 set(INC
4         ..
5 )
6
7 set(INC_SYS
8
9 )
10
11 set(SRC_CPU_KERNELS
12         kernels/cpu/kernel.cpp
13         kernels/cpu/kernel_sse2.cpp
14         kernels/cpu/kernel_sse3.cpp
15         kernels/cpu/kernel_sse41.cpp
16         kernels/cpu/kernel_avx.cpp
17         kernels/cpu/kernel_avx2.cpp
18         kernels/cpu/kernel_split.cpp
19         kernels/cpu/kernel_split_sse2.cpp
20         kernels/cpu/kernel_split_sse3.cpp
21         kernels/cpu/kernel_split_sse41.cpp
22         kernels/cpu/kernel_split_avx.cpp
23         kernels/cpu/kernel_split_avx2.cpp
24         kernels/cpu/filter.cpp
25         kernels/cpu/filter_sse2.cpp
26         kernels/cpu/filter_sse3.cpp
27         kernels/cpu/filter_sse41.cpp
28         kernels/cpu/filter_avx.cpp
29         kernels/cpu/filter_avx2.cpp
30 )
31
32 set(SRC_CUDA_KERNELS
33         kernels/cuda/kernel.cu
34         kernels/cuda/kernel_split.cu
35         kernels/cuda/filter.cu
36 )
37
38 set(SRC_OPENCL_KERNELS
39         kernels/opencl/kernel.cl
40         kernels/opencl/kernel_state_buffer_size.cl
41         kernels/opencl/kernel_split.cl
42         kernels/opencl/kernel_data_init.cl
43         kernels/opencl/kernel_path_init.cl
44         kernels/opencl/kernel_queue_enqueue.cl
45         kernels/opencl/kernel_scene_intersect.cl
46         kernels/opencl/kernel_lamp_emission.cl
47         kernels/opencl/kernel_do_volume.cl
48         kernels/opencl/kernel_indirect_background.cl
49         kernels/opencl/kernel_shader_setup.cl
50         kernels/opencl/kernel_shader_sort.cl
51         kernels/opencl/kernel_shader_eval.cl
52         kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl
53         kernels/opencl/kernel_subsurface_scatter.cl
54         kernels/opencl/kernel_direct_lighting.cl
55         kernels/opencl/kernel_shadow_blocked_ao.cl
56         kernels/opencl/kernel_shadow_blocked_dl.cl
57         kernels/opencl/kernel_enqueue_inactive.cl
58         kernels/opencl/kernel_next_iteration_setup.cl
59         kernels/opencl/kernel_indirect_subsurface.cl
60         kernels/opencl/kernel_buffer_update.cl
61         kernels/opencl/filter.cl
62 )
63
64 set(SRC_BVH_HEADERS
65         bvh/bvh.h
66         bvh/bvh_nodes.h
67         bvh/bvh_shadow_all.h
68         bvh/bvh_local.h
69         bvh/bvh_traversal.h
70         bvh/bvh_types.h
71         bvh/bvh_volume.h
72         bvh/bvh_volume_all.h
73         bvh/qbvh_nodes.h
74         bvh/qbvh_shadow_all.h
75         bvh/qbvh_local.h
76         bvh/qbvh_traversal.h
77         bvh/qbvh_volume.h
78         bvh/qbvh_volume_all.h
79         bvh/obvh_nodes.h
80         bvh/obvh_shadow_all.h
81         bvh/obvh_local.h
82         bvh/obvh_traversal.h
83         bvh/obvh_volume.h
84         bvh/obvh_volume_all.h
85         bvh/bvh_embree.h
86 )
87
88 set(SRC_HEADERS
89         kernel_accumulate.h
90         kernel_bake.h
91         kernel_camera.h
92         kernel_color.h
93         kernel_compat_cpu.h
94         kernel_compat_cuda.h
95         kernel_compat_opencl.h
96         kernel_differential.h
97         kernel_emission.h
98         kernel_film.h
99         kernel_globals.h
100         kernel_id_passes.h
101         kernel_jitter.h
102         kernel_light.h
103         kernel_math.h
104         kernel_montecarlo.h
105         kernel_passes.h
106         kernel_path.h
107         kernel_path_branched.h
108         kernel_path_common.h
109         kernel_path_state.h
110         kernel_path_surface.h
111         kernel_path_subsurface.h
112         kernel_path_volume.h
113         kernel_profiling.h
114         kernel_projection.h
115         kernel_queues.h
116         kernel_random.h
117         kernel_shader.h
118         kernel_shadow.h
119         kernel_subsurface.h
120         kernel_textures.h
121         kernel_types.h
122         kernel_volume.h
123         kernel_work_stealing.h
124 )
125
126 set(SRC_KERNELS_CPU_HEADERS
127         kernel.h
128         kernels/cpu/kernel_cpu.h
129         kernels/cpu/kernel_cpu_impl.h
130         kernels/cpu/kernel_cpu_image.h
131         kernels/cpu/filter_cpu.h
132         kernels/cpu/filter_cpu_impl.h
133 )
134
135 set(SRC_KERNELS_CUDA_HEADERS
136         kernels/cuda/kernel_config.h
137         kernels/cuda/kernel_cuda_image.h
138 )
139
140 set(SRC_KERNELS_OPENCL_HEADERS
141         kernels/opencl/kernel_split_function.h
142         kernels/opencl/kernel_opencl_image.h
143 )
144
145 set(SRC_CLOSURE_HEADERS
146         closure/alloc.h
147         closure/bsdf.h
148         closure/bsdf_ashikhmin_velvet.h
149         closure/bsdf_diffuse.h
150         closure/bsdf_diffuse_ramp.h
151         closure/bsdf_microfacet.h
152         closure/bsdf_microfacet_multi.h
153         closure/bsdf_microfacet_multi_impl.h
154         closure/bsdf_oren_nayar.h
155         closure/bsdf_phong_ramp.h
156         closure/bsdf_reflection.h
157         closure/bsdf_refraction.h
158         closure/bsdf_toon.h
159         closure/bsdf_transparent.h
160         closure/bsdf_util.h
161         closure/bsdf_ashikhmin_shirley.h
162         closure/bsdf_hair.h
163         closure/bssrdf.h
164         closure/emissive.h
165         closure/volume.h
166         closure/bsdf_principled_diffuse.h
167         closure/bsdf_principled_sheen.h
168     closure/bsdf_hair_principled.h
169 )
170
171 set(SRC_SVM_HEADERS
172         svm/svm.h
173         svm/svm_ao.h
174         svm/svm_attribute.h
175         svm/svm_bevel.h
176         svm/svm_blackbody.h
177         svm/svm_bump.h
178         svm/svm_camera.h
179         svm/svm_closure.h
180         svm/svm_convert.h
181         svm/svm_checker.h
182         svm/svm_color_util.h
183         svm/svm_brick.h
184         svm/svm_displace.h
185         svm/svm_fresnel.h
186         svm/svm_wireframe.h
187         svm/svm_wavelength.h
188         svm/svm_gamma.h
189         svm/svm_brightness.h
190         svm/svm_geometry.h
191         svm/svm_gradient.h
192         svm/svm_hsv.h
193         svm/svm_ies.h
194         svm/svm_image.h
195         svm/svm_invert.h
196         svm/svm_light_path.h
197         svm/svm_magic.h
198         svm/svm_mapping.h
199         svm/svm_math.h
200         svm/svm_math_util.h
201         svm/svm_mix.h
202         svm/svm_musgrave.h
203         svm/svm_noise.h
204         svm/svm_noisetex.h
205         svm/svm_normal.h
206         svm/svm_ramp.h
207         svm/svm_ramp_util.h
208         svm/svm_sepcomb_hsv.h
209         svm/svm_sepcomb_vector.h
210         svm/svm_sky.h
211         svm/svm_tex_coord.h
212         svm/svm_texture.h
213         svm/svm_types.h
214         svm/svm_value.h
215         svm/svm_vector_transform.h
216         svm/svm_voronoi.h
217         svm/svm_voxel.h
218         svm/svm_wave.h
219 )
220
221 set(SRC_GEOM_HEADERS
222         geom/geom.h
223         geom/geom_attribute.h
224         geom/geom_curve.h
225         geom/geom_curve_intersect.h
226         geom/geom_motion_curve.h
227         geom/geom_motion_triangle.h
228         geom/geom_motion_triangle_intersect.h
229         geom/geom_motion_triangle_shader.h
230         geom/geom_object.h
231         geom/geom_patch.h
232         geom/geom_primitive.h
233         geom/geom_subd_triangle.h
234         geom/geom_triangle.h
235         geom/geom_triangle_intersect.h
236         geom/geom_volume.h
237 )
238
239 set(SRC_FILTER_HEADERS
240         filter/filter.h
241         filter/filter_defines.h
242         filter/filter_features.h
243         filter/filter_features_sse.h
244         filter/filter_kernel.h
245         filter/filter_nlm_cpu.h
246         filter/filter_nlm_gpu.h
247         filter/filter_prefilter.h
248         filter/filter_reconstruction.h
249         filter/filter_transform.h
250         filter/filter_transform_gpu.h
251         filter/filter_transform_sse.h
252 )
253
254 set(SRC_UTIL_HEADERS
255         ../util/util_atomic.h
256         ../util/util_color.h
257         ../util/util_defines.h
258         ../util/util_half.h
259         ../util/util_hash.h
260         ../util/util_math.h
261         ../util/util_math_fast.h
262         ../util/util_math_intersect.h
263         ../util/util_math_float2.h
264         ../util/util_math_float3.h
265         ../util/util_math_float4.h
266         ../util/util_math_int2.h
267         ../util/util_math_int3.h
268         ../util/util_math_int4.h
269         ../util/util_math_matrix.h
270         ../util/util_projection.h
271         ../util/util_rect.h
272         ../util/util_static_assert.h
273         ../util/util_transform.h
274         ../util/util_texture.h
275         ../util/util_types.h
276         ../util/util_types_float2.h
277         ../util/util_types_float2_impl.h
278         ../util/util_types_float3.h
279         ../util/util_types_float3_impl.h
280         ../util/util_types_float4.h
281         ../util/util_types_float4_impl.h
282         ../util/util_types_float8.h
283         ../util/util_types_float8_impl.h
284         ../util/util_types_int2.h
285         ../util/util_types_int2_impl.h
286         ../util/util_types_int3.h
287         ../util/util_types_int3_impl.h
288         ../util/util_types_int4.h
289         ../util/util_types_int4_impl.h
290         ../util/util_types_uchar2.h
291         ../util/util_types_uchar2_impl.h
292         ../util/util_types_uchar3.h
293         ../util/util_types_uchar3_impl.h
294         ../util/util_types_uchar4.h
295         ../util/util_types_uchar4_impl.h
296         ../util/util_types_uint2.h
297         ../util/util_types_uint2_impl.h
298         ../util/util_types_uint3.h
299         ../util/util_types_uint3_impl.h
300         ../util/util_types_uint4.h
301         ../util/util_types_uint4_impl.h
302         ../util/util_types_ushort4.h
303         ../util/util_types_vector3.h
304         ../util/util_types_vector3_impl.h
305 )
306
307 set(SRC_SPLIT_HEADERS
308         split/kernel_branched.h
309         split/kernel_buffer_update.h
310         split/kernel_data_init.h
311         split/kernel_direct_lighting.h
312         split/kernel_do_volume.h
313         split/kernel_enqueue_inactive.h
314         split/kernel_holdout_emission_blurring_pathtermination_ao.h
315         split/kernel_indirect_background.h
316         split/kernel_indirect_subsurface.h
317         split/kernel_lamp_emission.h
318         split/kernel_next_iteration_setup.h
319         split/kernel_path_init.h
320         split/kernel_queue_enqueue.h
321         split/kernel_scene_intersect.h
322         split/kernel_shader_setup.h
323         split/kernel_shader_sort.h
324         split/kernel_shader_eval.h
325         split/kernel_shadow_blocked_ao.h
326         split/kernel_shadow_blocked_dl.h
327         split/kernel_split_common.h
328         split/kernel_split_data.h
329         split/kernel_split_data_types.h
330         split/kernel_subsurface_scatter.h
331 )
332
333 # CUDA module
334
335 if(WITH_CYCLES_CUDA_BINARIES)
336         # 64 bit only
337         set(CUDA_BITS 64)
338
339         # CUDA version
340         execute_process(COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT)
341         string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${NVCC_OUT}")
342         string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${NVCC_OUT}")
343         set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
344
345         # warn for other versions
346         if(CUDA_VERSION MATCHES "90" OR CUDA_VERSION MATCHES "91" OR CUDA_VERSION MATCHES "100")
347         else()
348                 message(WARNING
349                         "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
350                         "build may succeed but only CUDA 9.0, 9.1 and 10.0 are officially supported")
351         endif()
352
353         # build for each arch
354         set(cuda_sources kernels/cuda/kernel.cu kernels/cuda/kernel_split.cu
355                 ${SRC_HEADERS}
356                 ${SRC_KERNELS_CUDA_HEADERS}
357                 ${SRC_BVH_HEADERS}
358                 ${SRC_SVM_HEADERS}
359                 ${SRC_GEOM_HEADERS}
360                 ${SRC_CLOSURE_HEADERS}
361                 ${SRC_UTIL_HEADERS}
362         )
363         set(cuda_filter_sources kernels/cuda/filter.cu
364                 ${SRC_HEADERS}
365                 ${SRC_KERNELS_CUDA_HEADERS}
366                 ${SRC_FILTER_HEADERS}
367                 ${SRC_UTIL_HEADERS}
368         )
369         set(cuda_cubins)
370
371         macro(CYCLES_CUDA_KERNEL_ADD arch prev_arch name flags sources experimental)
372                 set(cuda_cubin ${name}_${arch}.cubin)
373
374                 set(kernel_sources ${sources})
375                 if(NOT ${prev_arch} STREQUAL "none")
376                         set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.cubin)
377                 endif()
378
379                 set(cuda_kernel_src "/kernels/cuda/${name}.cu")
380
381                 set(cuda_flags
382                         -D CCL_NAMESPACE_BEGIN=
383                         -D CCL_NAMESPACE_END=
384                         -D NVCC
385                         -m ${CUDA_BITS}
386                         -I ${CMAKE_CURRENT_SOURCE_DIR}/..
387                         -I ${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda
388                         --use_fast_math
389                         -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin})
390
391                 if(${experimental})
392                         set(cuda_flags ${cuda_flags} -D __KERNEL_EXPERIMENTAL__)
393                         set(name ${name}_experimental)
394                 endif()
395
396                 if(WITH_CYCLES_DEBUG)
397                         set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
398                 endif()
399
400                 # Workaround to build only sm_7x kernels with CUDA 10, until
401                 # older kernels work well with this version.
402                 if(DEFINED CUDA10_NVCC_EXECUTABLE  AND (${arch} MATCHES "sm_7."))
403                         set(with_cubin_compiler OFF)
404                         set(cuda_nvcc_executable "${CUDA10_NVCC_EXECUTABLE}")
405                         set(cuda_toolkit_root_dir "${CUDA10_TOOLKIT_ROOT_DIR}")
406                 else()
407                         set(with_cubin_compiler ${WITH_CYCLES_CUBIN_COMPILER})
408                         set(cuda_nvcc_executable "${CUDA_NVCC_EXECUTABLE}")
409                         set(cuda_toolkit_root_dir "${CUDA_TOOLKIT_ROOT_DIR}")
410                 endif()
411
412                 if(with_cubin_compiler)
413                         string(SUBSTRING ${arch} 3 -1 CUDA_ARCH)
414
415                         # Needed to find libnvrtc-builtins.so. Can't do it from inside
416                         # cycles_cubin_cc since the env variable is read before main()
417                         if(APPLE)
418                                 set(CUBIN_CC_ENV ${CMAKE_COMMAND}
419                                         -E env DYLD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib")
420                         elseif(UNIX)
421                                 set(CUBIN_CC_ENV ${CMAKE_COMMAND}
422                                         -E env LD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib64")
423                         endif()
424
425                         add_custom_command(
426                                 OUTPUT ${cuda_cubin}
427                                 COMMAND ${CUBIN_CC_ENV}
428                                                 "$<TARGET_FILE:cycles_cubin_cc>"
429                                                 -target ${CUDA_ARCH}
430                                                 -i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
431                                                 ${cuda_flags}
432                                                 -v
433                                                 -cuda-toolkit-dir "${cuda_toolkit_root_dir}"
434                                 DEPENDS ${kernel_sources} cycles_cubin_cc)
435                 else()
436                         add_custom_command(
437                                 OUTPUT ${cuda_cubin}
438                                 COMMAND ${cuda_nvcc_executable}
439                                                 -arch=${arch}
440                                                 ${CUDA_NVCC_FLAGS}
441                                                 --cubin
442                                                 ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
443                                                 --ptxas-options="-v"
444                                                 ${cuda_flags}
445                                 DEPENDS ${kernel_sources})
446                 endif()
447                 delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
448                 list(APPEND cuda_cubins ${cuda_cubin})
449
450                 unset(cuda_debug_flags)
451         endmacro()
452
453         set(prev_arch "none")
454         foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
455                 if(${arch} MATCHES "sm_2.")
456                         message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.")
457                 elseif(${arch} MATCHES "sm_7." AND (${CUDA_VERSION} LESS 100) AND (NOT DEFINED CUDA10_NVCC_EXECUTABLE))
458                         message(STATUS "CUDA binaries for ${arch} require CUDA 10.0+, skipped.")
459                 else()
460                         # Compile regular kernel
461                         CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} filter "" "${cuda_filter_sources}" FALSE)
462                         CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} kernel "" "${cuda_sources}" FALSE)
463
464                         if(WITH_CYCLES_CUDA_SPLIT_KERNEL_BINARIES)
465                                 # Compile split kernel
466                                 CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} kernel_split "-D __SPLIT__" "${cuda_sources}" FALSE)
467                         endif()
468
469                         if(WITH_CYCLES_CUDA_BUILD_SERIAL)
470                                 set(prev_arch ${arch})
471                         endif()
472                 endif()
473         endforeach()
474
475         add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
476         cycles_set_solution_folder(cycles_kernel_cuda)
477 endif()
478
479 # OSL module
480
481 if(WITH_CYCLES_OSL)
482         add_subdirectory(osl)
483         add_subdirectory(shaders)
484 endif()
485
486 # CPU module
487
488 include_directories(${INC})
489 include_directories(SYSTEM ${INC_SYS})
490
491 set_source_files_properties(kernels/cpu/kernel.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
492 set_source_files_properties(kernels/cpu/kernel_split.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
493 set_source_files_properties(kernels/cpu/filter.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
494
495 if(CXX_HAS_SSE)
496         set_source_files_properties(kernels/cpu/kernel_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
497         set_source_files_properties(kernels/cpu/kernel_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
498         set_source_files_properties(kernels/cpu/kernel_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
499         set_source_files_properties(kernels/cpu/kernel_split_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
500         set_source_files_properties(kernels/cpu/kernel_split_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
501         set_source_files_properties(kernels/cpu/kernel_split_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
502         set_source_files_properties(kernels/cpu/filter_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
503         set_source_files_properties(kernels/cpu/filter_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
504         set_source_files_properties(kernels/cpu/filter_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
505 endif()
506
507 if(CXX_HAS_AVX)
508         set_source_files_properties(kernels/cpu/kernel_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
509         set_source_files_properties(kernels/cpu/kernel_split_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
510         set_source_files_properties(kernels/cpu/filter_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
511 endif()
512
513 if(CXX_HAS_AVX2)
514         set_source_files_properties(kernels/cpu/kernel_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
515         set_source_files_properties(kernels/cpu/kernel_split_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
516         set_source_files_properties(kernels/cpu/filter_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
517 endif()
518
519 cycles_add_library(cycles_kernel
520         ${SRC_CPU_KERNELS}
521         ${SRC_CUDA_KERNELS}
522         ${SRC_OPENCL_KERNELS}
523         ${SRC_HEADERS}
524         ${SRC_KERNELS_CPU_HEADERS}
525         ${SRC_KERNELS_CUDA_HEADERS}
526         ${SRC_KERNELS_OPENCL_HEADERS}
527         ${SRC_BVH_HEADERS}
528         ${SRC_CLOSURE_HEADERS}
529         ${SRC_FILTER_HEADERS}
530         ${SRC_SVM_HEADERS}
531         ${SRC_GEOM_HEADERS}
532         ${SRC_SPLIT_HEADERS}
533 )
534
535 if(WITH_CYCLES_CUDA)
536         add_dependencies(cycles_kernel cycles_kernel_cuda)
537 endif()
538
539 # OpenCL kernel
540
541 #set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
542 #add_custom_command(
543 #       OUTPUT ${KERNEL_PREPROCESSED}
544 #       COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED}
545 #       DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
546 #add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
547 #delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
548
549 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_OPENCL_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl)
550 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CUDA_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda)
551 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel)
552 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_OPENCL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl)
553 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_CUDA_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda)
554 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_BVH_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/bvh)
555 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/closure)
556 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_FILTER_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/filter)
557 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/svm)
558 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/geom)
559 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/util)
560 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SPLIT_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/split)