OpenCL-CTS
OpenCL-CTS copied to clipboard
Missing tests for work-item functions with out-of-range arguments
The OpenCL C work-item functions have defined results for all values of their dimidx argument, even those that are out-of-range. For example, for get_global_size:
Valid values of dimindx are 0 to get_work_dim() - 1. For other values of dimindx, get_global_size() returns 1.
This behavior is not tested by the CTS, though, and all tested values are in-bounds.
We should test:
- All relevant work-item functions: get_global_size, get_global_id, get_local_size, get_enqueued_local_size, get_local_id, get_num_groups, get_group_id, get_global_offset.
- Cases when the out-of-range value is known at compile time, and when the out-of-range value is dynamic and is not known to be out-of-range until runtime.
- Cases with 1D, 2D, and 3D ND-ranges, since this will change when a dimidx is out-of-range.
Mesa has some piglit tests we could use for inspiration, see for example: https://gitlab.freedesktop.org/mesa/piglit/-/blob/main/tests/cl/program/execute/global-offset.cl
See also: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2638