Is it possible to manually throw an exception in OpenCL, just for debugging purposes? I am having a very strange error in my code: when I computed two double values and add them up, the host reports “CL_OUT_OF_RESOURCE”. However if I don’t add these two values, the host doesn’t report any error.
Is it possible to manually throw an exception in OpenCL, just for debugging purposes?
Share
Exceptions are not supported in OpenCL – it is based on the C99 language.
On AMD GPUs you can use
printfinside the kernel – see thecl_amd_printfextension. To use, put this at the top of your .cl file: