Fix incorrectly passing buffer read/write copy rect tests#2701
Open
ahesham-arm wants to merge 2 commits into
Open
Fix incorrectly passing buffer read/write copy rect tests#2701ahesham-arm wants to merge 2 commits into
ahesham-arm wants to merge 2 commits into
Conversation
The macro should fail the test, instead of just logging. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
The OpenCL specification states that for `clEnqueueCopyBufferRect`, if `row_pitch` is 0, it is computed as `region[0]`. If `slice_pitch` is not 0, it must be a multiple of the effective row_pitch. The test was generating `row_pitch` and `slice_pitch` independentely, so it could (and did) pass `row_pitch` 0 with `slice_pitch` based on the full buffer width. For sub-rectangles, this can (and did) make `slice_pitch` not a multiple of the computed `row_pitch`, causing the implementation to correctly return `CL_INVALID_VALUE`. Generate `row_pitch` first, then derive any explicit `slice_pitch` from the effective `row_pitch`. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
rjodinchr
approved these changes
May 26, 2026
bashbaug
approved these changes
May 26, 2026
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.
Running
test_basic bufferreadwriterectwas reporting an error in the log, but the test was still reporting as passing.Furthermore, the test itself is incorrect, it violates the specification for
clEnqueueCopyBufferRectwhich states:Effectively, this means that if
src_row_pitchis zero,src_slice_pitchshould be computed asregion[1]×region[0], which was not being done, the two values were calculated independently.This change has two commits, the first fixes the error reporting macro to actually fail the test, and the second fixes the test random generation logic.