Kernel Configuration#
kernel_param
Class Template#
kernel_param
is a generic structure for configuring SYCL* kernels.
Each kernel template is invoked with a kernel_param
type or object.
Typically, a kernel template supports multiple values for the configuration parameters.
Optimal values may depend on the invoked kernel, the data size and type(s), as well as on the used device.
A synopsis of the kernel_param
struct is provided below:
// defined in <oneapi/dpl/experimental/kernel_templates>
namespace oneapi::dpl::experimental::kt {
template <std::uint16_t DataPerWorkItem,
std::uint16_t WorkGroupSize,
typename KernelName = /*unspecified*/>
struct kernel_param;
}
Static Member Constants#
Name |
Value |
Description |
---|---|---|
|
|
The number of iterations to be processed by a work-item. |
|
|
The number of work-items within a work-group. |
Note
The data_per_workitem
parameter has a special meaning in ESIMD-based kernel templates.
Usually, each work-item processes data_per_workitem
input elements sequentially.
However, work-items in ESIMD-based kernel templates perform vectorization,
so the sequential work is data_per_workitem / vector_length
elements, where vector_length
is an implementation-defined vectorization factor.
Member Types#
Type |
Definition |
Description |
---|---|---|
|
|
An optional parameter that is used to set a kernel name. Note The If omitted, SYCL kernel name(s) will be automatically generated. If provided, it must be a unique C++ typename that satisfies the requirements for SYCL kernel names in the SYCL 2020 Specification. Note The provided name can be augmented by oneDPL when used with a template that creates multiple SYCL kernels. |