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