I'm having a weird issue with OpenCL where I'm calling clEnqueueNDRangeKernel
for a kernel that uses a large memory buffer as an argument. For a buffer smaller than 16384 bytes everything works fine. If I increase the buffer size beyond that it returns an INVALID_KERNEL_ARGS error. As I understand, this error is meant to indicate an argument is not set. Setting an argument to an invalid size or something that doesn't fit in memory should trigger a different error.
Any ideas?
UPDATE
The answer from @mfa led me to look at the device specs again. It seems a 128*128 float array is exactly 64KB, which is the size of the card's constant memory. The global memory is much larger, so using __global instead of __constant for the kernel parameter fixes it.
But I'm still confused: How is an out-of-memory argument for const memory every to be called? It seems to me when I create the buffer it's not yet known if it'll be used as constant or global... Is there any way to get a more helpful error message?
__constant
memory. If your buffer is bigger than this size then the parameter you are passing to your kernel to be constant is invalid, therefore the error. – DarkZeros