At the moment clSetKernelArg states:
If the argument is declared with the constant qualifier, the size in bytes of the memory object cannot exceed CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
but no such statement is made for clSetKernelArgSVMPointer.
But as far as I can see clSetKernelArg doesn't declare an error if the application would do it anyway. I think we should define what expectations to have here. Should clSetKernelArg return an error if the allocation is too big? Shouldn't be a problem for applications, because they can always create SubBuffers.
What should we do about clSetKernelArgSVMPointer? Doing sub allocation isn't doable with the current API and not sure if unified SVM is going to change that. One could use CL_MEM_USE_HOST_PTR with clCreateBuffer, but it's also not forbidden to use SVM allocations for constant * arguments.
Should application expect that only up to CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE is addressable here? Or should the call fail?
@bashbaug for awareness.