Valid Size Arguments to clEnqueueSVMMemFill and clEnqueueSVMMemcpy
Currently, the spec is unclear whether zero should be allowed for the size argument to clEnqueueSVMMemFill and clEnqueueSVMMemcpy.
For the cl_khr_unified_svm extension, we are leaning towards allowing the size to be zero for clEnqueueSVMMemFill and clEnqueueSVMMemcpy. Much like a zero-sized enqueue, when the size is zero the command will behave similarly to an enqueued marker.
Should we clarify that a size of zero is valid in general, independent of the cl_khr_unified_svm extension?
Here are some draft tests to check how an implementation behaves when it is passed a size of zero for these SVM APIs and a few others:
- https://github.com/KhronosGroup/OpenCL-CTS/pull/2431
Most of the implementations I've tested return an error in at least a few cases.
Discussed in the November 4th memory subgroup:
- We aren't going to require any new behavior for implementations that do not support
cl_khr_unified_svm. - We are going to test this behavior for implementations that do support
cl_khr_unified_svm, even if the allocations are made via the older SVM APIs and not the newer unified SVM APIs.
For more detail, please see the linked CTS PR.