The parallel_for
overload without an offset can be called with either a number or a braced-init-list with 1-3 elements.
It’s described in https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_parallel_for_invoke
For following kernel invocations:
-
parallel_for(N, some_kernel)
with array size isN
-
parallel_for({N}, some_kernel)
with array size isN
-
parallel_for({N1, N2}, some_kernel)
with array size isN1 * N2
-
parallel_for({N1, N2, N3}, some_kernel)
with array size isN1 * N2 * N3
With N, N1 = 2
, N2 = 3
, N3 = 5
.
-
Create an array of corresponding size and buffer for access to it.
-
Invoke
some_kernel
that takesitem
argument and fills buffer via accessor with linear_id of theitem
. -
Check that all elements of array is equal to its index.