Developer Guide


Specify Number of SIMD Work-Items

You have the option to increase the data-processing efficiency of a SYCL kernel by executing multiple work-items in a single instruction multiple data (SIMD) manner without manually vectorizing your kernel code.
Specify the number of work-items within a work-group that the
Intel® oneAPI
should execute in a SIMD or vectorized manner.
Introduce the
attribute in conjunction with the
[[cl::reqd_work_group_size(Z, Y, X)]]
attribute. The
attribute you specify must evenly divide the work-group size you specify for the
[[cl::reqd_work_group_size(Z, Y, X)]]
To specify the number of SIMD work-items in a work-group, insert the
attribute in the kernel source code.
Consider the following example:
cgh.parallel_for<class kernelComputeSIMD>( nd_range<1>(range<1>(N), range<1>(REQD_WORK_GROUP_SIZE)), [=] (nd_item<id> it) [[intel::num_simd_work_items(NUM_SIMD_WORK_ITEMS), cl::reqd_work_group_size(1, 1, REQD_WORK_GROUP_SIZE)]] { auto gid = it.get_global_id(0); accessorRes[gid] = cl::sycl::sqrt(accessorIdx[gid]); }
Always use the
attribute with
[[cl::reqd_work_group_size(Z, Y, X)]]
, and
must be 0.
For additional information about
[[cl::reqd_work_group_size(Z, Y, X)]]
attribute, refer to Specify a Work-Group Size.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at