Basic implementation of cl_ext_image_requirements_info - #887
Open
kpet wants to merge 3 commits into
Open
Conversation
Change-Id: Ie87de001b88df9cc4bf8fcf7165852952e29a24d Signed-off-by: Kévin Petit <kpet@free.fr>
rjodinchr
reviewed
Jul 29, 2026
Comment on lines
+6720
to
+6766
| switch (param_name) { | ||
| case CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT: | ||
| val_uint = device->image_max_width(flags, image_desc, image_format); | ||
| copy_ptr = &val_uint; | ||
| size_ret = sizeof(val_uint); | ||
| break; | ||
| case CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT: | ||
| if ((image_desc != nullptr) && | ||
| !(image_desc->image_type == 0 || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | ||
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | ||
| break; | ||
| } | ||
| val_uint = device->image_max_height(flags, image_desc, image_format); | ||
| copy_ptr = &val_uint; | ||
| size_ret = sizeof(val_uint); | ||
| break; | ||
| case CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT: | ||
| if ((image_desc != nullptr) && | ||
| !(image_desc->image_type == 0 || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | ||
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | ||
| break; | ||
| } | ||
| val_uint = device->image_max_depth(flags, image_desc, image_format); | ||
| copy_ptr = &val_uint; | ||
| size_ret = sizeof(val_uint); | ||
| break; | ||
| case CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT: | ||
| if ((image_desc != nullptr) && | ||
| !(image_desc->image_type == 0 || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY || | ||
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY)) { | ||
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | ||
| break; | ||
| } | ||
| val_uint = | ||
| device->image_max_array_size(flags, image_desc, image_format); | ||
| copy_ptr = &val_uint; | ||
| size_ret = sizeof(val_uint); | ||
| break; | ||
| default: | ||
| ret = CL_INVALID_VALUE; | ||
| break; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| switch (param_name) { | |
| case CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT: | |
| val_uint = device->image_max_width(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == 0 || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = device->image_max_height(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == 0 || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = device->image_max_depth(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == 0 || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = | |
| device->image_max_array_size(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| default: | |
| ret = CL_INVALID_VALUE; | |
| break; | |
| } | |
| switch (param_name) { | |
| case CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT: | |
| val_uint = device->image_max_width(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == CL_MEM_OBJECT_IMAGE2D || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = device->image_max_height(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == CL_MEM_OBJECT_IMAGE3D)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = device->image_max_depth(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| case CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT: | |
| if ((image_desc != nullptr) && | |
| !(image_desc->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY || | |
| image_desc->image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY)) { | |
| ret = CL_INVALID_IMAGE_DESCRIPTOR; | |
| break; | |
| } | |
| val_uint = | |
| device->image_max_array_size(flags, image_desc, image_format); | |
| copy_ptr = &val_uint; | |
| size_ret = sizeof(val_uint); | |
| break; | |
| default: | |
| ret = CL_INVALID_VALUE; | |
| break; | |
| } |
image_desc->image_type != 0 for sure because of the call to is_valid_image_descriptor earlier in the function.
Co-authored-by: Romaric Jodin <rjodin@google.com>
Co-authored-by: Romaric Jodin <rjodin@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change-Id: Ie87de001b88df9cc4bf8fcf7165852952e29a24d