zif520 / opencl-book-samples

Automatically exported from code.google.com/p/opencl-book-samples
0 stars 0 forks source link

Problem Chapter 16 Example #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 tomcool...@gmail.com on 17 Feb 2012 at 2:57

GoogleCodeExporter commented 8 years ago
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 edel...@gmail.com on 23 Feb 2012 at 8:46