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

kernel_image_methods: Fix size checks in 1Dbuffer case #2106

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

dneto0
Copy link
Contributor

@dneto0 dneto0 commented Oct 8, 2024

Image height is initialized to 0. But the size calculation should assume a height of 1.

Image height is initialized to 0.  But the size calculation should
assume a height of 1.
@@ -262,8 +262,7 @@ int test_get_image_info_1D_buffer(cl_device_id device, cl_context context,
imageInfo.rowPitch += extraWidth;
} while ((imageInfo.rowPitch % pixelSize) != 0);

size = (cl_ulong)imageInfo.rowPitch * (cl_ulong)imageInfo.height
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageInfo.height is initialized to 0 earlier, so the loop exits right away. The loop has not been doing anything useful. Change the calculation to use an assumed height of 1.

@bashbaug
Copy link
Contributor

bashbaug commented Oct 8, 2024

I think #2090 tries to fix this too, but this looks like a better fix IMHO.

@lakshmih does this fix work for you?

@dneto0 could you please fix the size calculation in test_1D.cpp also? I think it has the same problem.
https://github.com/KhronosGroup/OpenCL-CTS/blob/main/test_conformance/images/kernel_image_methods/test_1D.cpp#L232

Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging as discussed in the November 5th teleconference.

@bashbaug bashbaug merged commit 040dc5f into KhronosGroup:main Nov 5, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants