opencl-book-samples icon indicating copy to clipboard operation
opencl-book-samples copied to clipboard

Problem Chapter 16 Example

Open GoogleCodeExporter opened this issue 9 years ago • 1 comments

I am trying to run the example code from chapter 16 on a 2011 macbook pro.
If i use cmake and generate unix make files i get an abort trap in the program. 
On the other hand, if i run it with Xcode, the --ref runs well (6.4s) but all 
the other ones crash and give the following errors


Line 229 in File 
/Users/tomcool/opencl-book-samples-read-only/src/Chapter_16/Dijkstra/oclDijkstra
Kernel.cpp


with lines 228 and 229 being
errNum = clEnqueueNDRangeKernel(commandQueue, initializeKernel, 1, NULL, 
&globalWorkSize, &localWorkSize,
                                    0, NULL, NULL);
    checkError(errNum, CL_SUCCESS);

Would you have any idea as to what the problem could be?
Thanks
T.


Original issue reported on code.google.com by [email protected] on 17 Feb 2012 at 2:57

GoogleCodeExporter avatar Mar 14 '15 09:03 GoogleCodeExporter

If you add the lines below to runDijkstra you'll find localWorkSize is actually 
smaller than the value returned by the CL_DEVICE_MAX_WORK_GROUP_SIZE check.

    size_t kernelLocalSize;
    errNum = clGetKernelWorkGroupInfo(initializeBuffersKernel, deviceId, CL_KERNEL_WORK_GROUP_SIZE, sizeof(kernelLocalSize), &kernelLocalSize, NULL);

The enqueue function will fail if the localWorkSize is larger than 
kernelLocalSize.

Original comment by [email protected] on 23 Feb 2012 at 8:46

GoogleCodeExporter avatar Mar 14 '15 09:03 GoogleCodeExporter