Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in error codes between legacy and new image creation API #1277

Open
lakshmih opened this issue Oct 25, 2024 · 2 comments
Open

Discrepancy in error codes between legacy and new image creation API #1277

lakshmih opened this issue Oct 25, 2024 · 2 comments

Comments

@lakshmih
Copy link
Contributor

Under error codes for clCreateImage/clCreateImageWithProperties, the API spec says:

  • 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.

@bashbaug
Copy link
Contributor

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.

@lakshmih lakshmih transferred this issue from KhronosGroup/OpenCL-CTS Nov 5, 2024
@lakshmih
Copy link
Contributor Author

lakshmih commented Nov 5, 2024

I did that, thanks for the reminder Ben!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants