diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-21 15:40:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-22 14:31:34 +0300 |
commit | 2c503d8303299c27b874e11e89a1229c00dfa55d (patch) | |
tree | ad9840adab05d881191fabc39b402dc66b83b36d /intern/cycles/device/device_opencl.cpp | |
parent | 7f4d5850fec772522729aff61d3695095fff0831 (diff) |
Cycles: Restructure kernel files organization
Since the kernel split work we're now having quite a few of new files, majority
of which are related on the kernel entry points. Keeping those files in the
root kernel folder will eventually make it really hard to follow which files are
actual implementation of Cycles kernel.
Those files are now moved to kernel/kernels/<device_type>. This way adding extra
entry points will be less noisy. It is also nice to have all device-specific
files grouped together.
Another change is in the way how split kernel invokes logic. Previously all the
logic was implemented directly in the .cl files, which makes it a bit tricky to
re-use the logic across other devices. Since we'll likely be looking into doing
same split work for CUDA devices eventually it makes sense to move logic from
.cl files to header files. Those files are stored in kernel/split. This does not
mean the header files will not give error messages when tried to be included
from other devices and their arguments will likely be changed, but having such
separation is a good start anyway.
There should be no functional changes.
Reviewers: juicyfruit, dingto
Differential Revision: https://developer.blender.org/D1314
Diffstat (limited to 'intern/cycles/device/device_opencl.cpp')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 88c2a2f58c3..d209340d0c4 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -748,7 +748,7 @@ public: } else { - string init_kernel_source = "#include \"kernel.cl\" // " + kernel_md5 + "\n"; + string init_kernel_source = "#include \"kernels/opencl/kernel.cl\" // " + kernel_md5 + "\n"; /* if does not exist or loading binary failed, compile kernel */ if(!compile_kernel(kernel_path, init_kernel_source, "", &cpProgram, debug_src)) @@ -1322,7 +1322,7 @@ public: /* Kernel loaded from binary, nothing to do. */ } else { - string init_kernel_source = "#include \"kernel.cl\" // " + + string init_kernel_source = "#include \"kernels/opencl/kernel.cl\" // " + kernel_md5 + "\n"; /* If does not exist or loading binary failed, compile kernel. */ if(!compile_kernel(kernel_path, @@ -1996,7 +1996,7 @@ public: #define GLUE(a, b) a ## b #define LOAD_KERNEL(name) \ do { \ - kernel_init_source = "#include \"kernel_" #name ".cl\" // " + \ + kernel_init_source = "#include \"kernels/opencl/kernel_" #name ".cl\" // " + \ kernel_md5 + "\n"; \ device_md5 = device_md5_hash(build_options); \ clbin = string_printf("cycles_kernel_%s_%s_" #name ".clbin", \ |