CL_INVALID_IMAGE_DESCRIPTOR if values specified in image_desc are not valid or if image_desc is NULL.
CL_INVALID_IMAGE_SIZE if image dimensions specified in image_desc exceed the maximum image dimensions described in the Device Queries table for all devices in context.
However for the legacy clCreateImage3D, spec says:
CL_INVALID_IMAGE_SIZE if image_width or image_height are 0 or if image_depth ≤ 1, or if they exceed the maximum values specified in CL_DEVICE_IMAGE3D_MAX_WIDTH, CL_DEVICE_IMAGE3D_MAX_HEIGHT or CL_DEVICE_IMAGE3D_MAX_DEPTH respectively for all devices in context, or if values specified by image_row_pitch and image_slice_pitch do not follow rules described in the argument description above.
This means, for e.g., that when trying to create a 3D image with depth 0 (and hence invalid), the new APIs are required to return CL_INVALID_IMAGE_DESCRIPTOR whereas the legacy API would return CL_INVALID_IMAGE_SIZE. It would be ideal to reconcile the error descriptions so we use/expand CL_INVALID_IMAGE_SIZE for this case as well rather than restrict it to exceeding the maximum dimension supported.
Do you mind if I transfer this issue to OpenCL-Docs? It seems like more of a spec issue than a test issue, unless there is also a test for the current error behavior.
Under error codes for clCreateImage/clCreateImageWithProperties, the API spec says:
However for the legacy clCreateImage3D, spec says: CL_INVALID_IMAGE_SIZE if image_width or image_height are 0 or if image_depth ≤ 1, or if they exceed the maximum values specified in CL_DEVICE_IMAGE3D_MAX_WIDTH, CL_DEVICE_IMAGE3D_MAX_HEIGHT or CL_DEVICE_IMAGE3D_MAX_DEPTH respectively for all devices in context, or if values specified by image_row_pitch and image_slice_pitch do not follow rules described in the argument description above. This means, for e.g., that when trying to create a 3D image with depth 0 (and hence invalid), the new APIs are required to return CL_INVALID_IMAGE_DESCRIPTOR whereas the legacy API would return CL_INVALID_IMAGE_SIZE. It would be ideal to reconcile the error descriptions so we use/expand CL_INVALID_IMAGE_SIZE for this case as well rather than restrict it to exceeding the maximum dimension supported.