How to display error code

Hi everyone,

I’m having some trouble with the following function :

errNum = clEnqueueNDRangeKernel(commandQueue,kernel,1,NULL,globalWorkSize,localWorkSize,0,NULL,NULL);
    printf("errNum = %d
",errNum);

As you can see, I get the error code -52.

It seems that each error code has a meaning ( CL_INVALID_MEM_OBJECT, CL_INVALID_PROGRAM and so far and so on)

Is there a way to associate my -52 error to a meaning?
for instance : -52 <=> CL_INVALID_BINARY

I thank you beforehand for your answers

Regards,

Elrachal

I think I saw elsewhere that you’re using Nvidia, but MacOS implementation has a header file called util_opencl.h with the following function in it

static char *print_cl_errstring(cl_int err)

Personally though, I just have a copy of cl.h open and I can quickly run my eye down to the right error code.

Personally though, I just have a copy of cl.h open and I can quickly run my eye down to the right error code

That’s optimal !!

Thank you :slight_smile: