bgaster / opencl-book-samples

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

Errata: Incorrect num_devices argument in clCreateContext (ch.3, pg.86) #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The fourth argument of the second call to clGetDeviceIDs() is 
“&devices[0]“, which is technically correct but inconsistent with the third 
argument of clCreateContext(), “devices“.

The real errata is the second argument of clCreateContext(), “size / 
sizeof(cl_device_id)“.  Here “size“ is undefined and the argument should 
instead be “num“.  

Original issue reported on code.google.com by Sean.Set...@gmail.com on 19 Aug 2011 at 11:32

GoogleCodeExporter commented 9 years ago
This is also another errata on the same page.  In the line before the second 
call to clGetDeviceIDs(), “alloca(num)“ should be “alloca(num * 
sizeof(cl_device_id))“.

Original comment by Sean.Set...@gmail.com on 19 Aug 2011 at 11:40