[Bf-blender-cvs] [c864f5d] master: Cycles: Error enqueueing split kernels should no longer cause infinite loop

Sergey Sharybin noreply at git.blender.org
Fri Jul 3 12:18:25 CEST 2015


Commit: c864f5d14044781cf66bf686a845435d78d0154f
Author: Sergey Sharybin
Date:   Fri Jul 3 12:13:02 2015 +0200
Branches: master
https://developer.blender.org/rBc864f5d14044781cf66bf686a845435d78d0154f

Cycles: Error enqueueing split kernels should no longer cause infinite loop

===================================================================

M	intern/cycles/device/device_opencl.cpp

===================================================================

diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 4dd92c3..11c16b5 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -2849,16 +2849,25 @@ public:
 		/* Macro for Enqueuing split kernels. */
 #define GLUE(a, b) a ## b
 #define ENQUEUE_SPLIT_KERNEL(kernelName, globalSize, localSize) \
-		opencl_assert(clEnqueueNDRangeKernel(cqCommandQueue, \
-		                                     GLUE(ckPathTraceKernel_, \
-		                                          kernelName), \
-		                                     2, \
-		                                     NULL, \
-		                                     globalSize, \
-		                                     localSize, \
-		                                     0, \
-		                                     NULL, \
-		                                     NULL))
+		{ \
+			ciErr = clEnqueueNDRangeKernel(cqCommandQueue, \
+			                               GLUE(ckPathTraceKernel_, \
+			                                    kernelName), \
+			                               2, \
+			                               NULL, \
+			                               globalSize, \
+			                               localSize, \
+			                               0, \
+			                               NULL, \
+			                               NULL); \
+			opencl_assert_err(ciErr, "clEnqueueNDRangeKernel"); \
+			if(ciErr != CL_SUCCESS) { \
+				string message = string_printf("OpenCL error: %s in clEnqueueNDRangeKernel()", \
+				                               clewErrorString(ciErr)); \
+				opencl_error(message); \
+				return; \
+			} \
+		} (void) 0
 
 		/* Enqueue ckPathTraceKernel_data_init kernel. */
 		ENQUEUE_SPLIT_KERNEL(data_init, global_size, local_size);




More information about the Bf-blender-cvs mailing list