[Bf-blender-cvs] [ed1fb242a8e] blender-v2.83-release: Fix T76469: OpenCL 1.2 Compilation
Jeroen Bakker
noreply at git.blender.org
Thu May 7 14:35:25 CEST 2020
Commit: ed1fb242a8ec7d60e6a2129ada0011d17810e6d6
Author: Jeroen Bakker
Date: Thu May 7 13:57:36 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBed1fb242a8ec7d60e6a2129ada0011d17810e6d6
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
===================================================================
M intern/cycles/kernel/kernel_compat_opencl.h
===================================================================
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
More information about the Bf-blender-cvs
mailing list