diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-03 13:13:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-03 13:13:38 +0300 |
commit | c864f5d14044781cf66bf686a845435d78d0154f (patch) | |
tree | 7a267372861e31e02f322e4987efd98380125132 /intern/cycles/device/device_opencl.cpp | |
parent | 145ab8c49efe0de188a55f4c682dd5fcf916f105 (diff) |
Cycles: Error enqueueing split kernels should no longer cause infinite loop
Diffstat (limited to 'intern/cycles/device/device_opencl.cpp')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 4dd92c3337a..11c16b5f29e 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); |