lppcom / opencl-book-samples

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

Errata: Incorrect param_value_size_ret argument in clGetDeviceInfo (ch.3, pg.70) #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The fifth argument in clGetDeviceInfo() is “&size“ but should probably be 
“NULL“.  If you specify the “param_value_size“ and a non-NULL 
“param_value“ then their is no need to also query the 
“param_value_size_ret“, right?  As written in the book, 
which--“param_value“, “param_value_size_ret“, or both--values are 
queried?

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

GoogleCodeExporter commented 8 years ago
It would be valid to pass NULL as the final argument but it is not required. In 
this case after the call size will be set to the number of bytes returned as a 
result of the query. So the code is valid.

Original comment by benedict...@gmail.com on 22 Aug 2011 at 8:09

GoogleCodeExporter commented 8 years ago
The variable maxComputeUnits should be defined ahead.

Original comment by shuningx...@gmail.com on 27 Jun 2012 at 11:52