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:
authorJeroen Bakker <jbakker>2020-05-07 14:57:36 +0300
committerJeroen Bakker <jeroen@blender.org>2020-05-07 15:34:50 +0300
commited1fb242a8ec7d60e6a2129ada0011d17810e6d6 (patch)
tree287e027be097a341c2872c9d5d472be74392408e /intern
parent18dbc8f5c15802acf41f729a3cbb66667c48f7c3 (diff)
Fix T76469: OpenCL 1.2 Compilation
Recent changes assumed OpenCL 2.0 platform. This adds a check to see if we are compiling on an OpenCL 2.0 platform. Patch was tested on: * AMD Radeon Pro WX 7100 with amdgpu-pro-19.50-1011208-ubuntu-18.04 drivers * AMD Vega 64 with amdgpu-pro-20.10-1048554-ubuntu-18.04 drivers * AMD RX 5700 with amdgpu-pro-20.10-1048554-ubuntu-18.04 drivers Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D7637
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 35dc95ca10d..ba7ab43a47a 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -43,12 +43,17 @@
#define ccl_local __local
#define ccl_local_param __local
#define ccl_private __private
-#define ccl_loop_no_unroll __attribute__((opencl_unroll_hint(1)))
#define ccl_restrict restrict
#define ccl_ref
#define ccl_align(n) __attribute__((aligned(n)))
#define ccl_optional_struct_init
+#if __OPENCL_VERSION__ >= 200
+# define ccl_loop_no_unroll __attribute__((opencl_unroll_hint(1)))
+#else
+# define ccl_loop_no_unroll
+#endif
+
#ifdef __SPLIT_KERNEL__
# define ccl_addr_space __global
#else