cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

Highlighted
Journeyman III
Journeyman III

Invalid arguments accepted in clSetKernelArg()

In the latest SDK, "OpenCL 1.2 AMD-APP (938.1)" and "OpenCL 1.2 AMD-APP (938.2)", setting a bad argument in clSetKernelArg() returns CL_SUCCESS instead of fail.

For example, say argument #0 is a memory-object, but instead, erroneously, the kernel itself is given as an argument:

cl_mem bad_memory_object = (cl_mem)kernel;

clSetKernelArg(kernel, 0, sizeof(cl_mem), &bad_memory_object);

Results in CL_SUCCESS, instead of CL_INVALID_MEM_OBJECT as it should.

(naturally, later attempts to run this kernel result in a segmentation-fault).

Please fix!

0 Kudos
Reply
4 Replies
Highlighted
Challenger
Challenger

Re: Invalid arguments accepted in clSetKernelArg()

This issue is related to the driver, not the SDK though.

Which version of the drivers is are you using? Which OS system/hardware? Is this issue exist when you use the latest drivers?

I am trying to reproduce the issue here.

Highlighted
Journeyman III
Journeyman III

Re: Invalid arguments accepted in clSetKernelArg()

I am using myself "OpenCL 1.2 AMD-APP (938.1)", with only the CPU (no drivers),

However also, one of our clients uses "OpenCL 1.2 AMD-APP (938.2)" with a GPU, but I don't know which driver they use.

We both use Linux and we both get this problem.

0 Kudos
Reply
Highlighted
Challenger
Challenger

Re: Invalid arguments accepted in clSetKernelArg()

Well, I can reproduce it. (Win7, A6, driver 8.96).

I am forwarding your message to the right person to see if you can get better answer. 

0 Kudos
Reply
Highlighted
Challenger
Challenger

Re: Invalid arguments accepted in clSetKernelArg()

On the other hand, since you write

"cl_mem bad_memory_object = (cl_mem)kernel;"

bad_memory_object IS a memory object. So I think

"clSetKernelArg(kernel, 0, sizeof(cl_mem), &bad_memory_object);"

could return CL_SUCCESS although "cl_mem bad_memory_object = (cl_mem)kernel;" is not recommended.

0 Kudos
Reply