0
votes

I've got an OpenCL program that utilizes the enqueue_kernel function inside my parent kernel.

Currently, after enqueue_kernel is called, enqueue_kernel is returning "-11" as its error code.

The CLK_XXX error codes (enqueue_kernel's return values) listed in the spec are not enumerated anywhere in the docs or header files, so I don't know which code I'm getting. How can I get my kernel to return meaningful errors?

Also, the spec states that by enabling the "-g" flag during clBuildProgram, enqueue_kernel will return more verbose codes. However, when I add "-g" to my list of flags, I get a compilation error saying "-g" flag is not recognized. I have the latest NVidia drivers which officially support OpenCL1.2, and unofficially support OpenCL2.0 (I'm not using any unsupported functions from 2.0 that I'm aware of, only the unofficially supported ones). I'm guessing I get a compilation error with "-g" because it's not officially or unofficially supported by NVidia yet. Is there a way to get NVidia's latest drivers to spit out better errors? A different flag, perhaps?

As a side note, I can get enqueue_kernel working for some child kernels, and not others...so it's not a matter of enqueue_kernel simply being unsupported on my drivers/hardware, hence the need to understand the error codes I'm getting.

1
Did you ever figure out the answer to this question? I am running into the same issue I need to be able to see the enqueue kernel error code and -1 isn't very helpful :/ - Porter Morgan
@PorterMorgan Unfortunately no, I ultimately went with a different approach than using enqueue_kernel altogether. - Tyson

1 Answers

-1
votes

-11 is CL_BUILD_PROGRAM_FAILURE. It's in the cl.h header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/

That code means your program has an error. Use clGetProgramBuildInfo with the flag CL_PROGRAM_BUILD_LOG to get the build log and learn the error.