Skip to content

basic: use size_t work-item index in constant test - #2852

Open
fzwolinski wants to merge 1 commit into
KhronosGroup:mainfrom
fzwolinski:type_fix
Open

fzwolinski wants to merge 1 commit into
KhronosGroup:mainfrom
fzwolinski:type_fix

Conversation

@fzwolinski

Copy link
Copy Markdown

The constant test sizes its buffers from the device limits, so on a
device with a large CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE the number of
work-items can exceed INT_MAX. Both kernels stored get_global_id(0) in
an int and the host verification loop used an int counter, so indices
above INT_MAX wrapped and the test failed even though the results were
correct.

Use size_t for the work-item index in both kernels and for the
verification loop counter.

[run-test: test_basic constant]

Signed-off-by: Fabian Zwoliński fabian.zwolinski@intel.com

@CLAassistant

CLAassistant commented Oct 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

The constant test sizes its buffers from the device limits, so on a
device with a large CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE the number of
work-items can exceed INT_MAX. Both kernels stored get_global_id(0) in
an int and the host verification loop used an int counter, so indices
above INT_MAX wrapped and the test failed even though the results were
correct.

Use size_t for the work-item index in both kernels and for the
verification loop counter.

[run-test: test_basic constant]

Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
@rjodinchr rjodinchr added focused review fast track Pull requests that are not expected to need working group discussion labels Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast track Pull requests that are not expected to need working group discussion focused review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants