preda / gpuowl

GPU Mersenne primality test.
GNU General Public License v3.0
176 stars 39 forks source link

Fix logging of long compiler messages #296

Closed proski closed 3 weeks ago

proski commented 2 months ago

Show compile logs up to 64k. The compile log for selftest.cl is about 33k on a system without double precision support.

Don't try calling clGetProgramBuildInfo() with the log size shorter than needed, the log won't be populated, and the returned string would contain uninitialized data.

Check the return value of both clGetProgramBuildInfo() calls.

proski commented 2 months ago

Quoting https://registry.khronos.org/OpenCL/sdk/3.0/docs/man/html/clGetProgramBuildInfo.html

clGetProgramBuildInfo returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

  • ...
  • CL_INVALID_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is < size of return type as described in the Program Build Queries table and param_value is not NULL.
preda commented 3 weeks ago

Thanks!