The OpenCL spec lists the following requirement for the function clEnqueueReadImage:
"slice_pitch in clEnqueueReadImage and input_slice_pitch in clEnqueueWriteImage is the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read or written respectively. This must be 0 if image is a 1D or 2D image. [...]"
But slice_pitch is not mentioned in the list of returned errors for these functions. What should a CL implementation do if slice_pitch is not 0 for a 1D or 2D image? Return CL_INVALID_VALUE? Or ignore the error and return CL_SUCCESS?
If CL_INVALID_VALUE is returned, the CTS test mem_host_flags fails ...
The text was updated successfully, but these errors were encountered:
Our implementation does return CL_INVALID_VALUE for this case. I just tested with an up-to-date CTS and we pass mem_host_flags, but perhaps the failure you see is connected to an optional type that we don't support.
However, the Intel GPU OpenCL implementation (which happens to be easy to run on my laptop) returns CL_SUCCESS.
I found the root cause why the test failed for me. It gets the slice pitch from an earlier clEnqueueMapImage, which should
(but doesn't) return zero for a 1D image. I have reported that bug to NVIDIA. They didn't notice the bug so far, because they ignore the non-zero slice pitch in clEnqueueReadImage, so the test succeeds for them.