template<int n_nondefault_params, int n_default_params, typename R, typename... Ts>
class syclcompat::args_selector< n_nondefault_params, n_default_params, R(Ts...)>
args_selector is a helper class for extracting arguments from an array of pointers to arguments or buffer of arguments to pass to a kernel function.
- Parameters
-
R(Ts...) | The type of the kernel |
n_nondefault_params | The number of nondefault parameters of the kernel (excluding parameters that like sycl::nd_item, etc.) |
n_default_params | The number of default parameters of the kernel |
Example usage: With the following kernel: void foo(sycl::float2 x, int n, sycl::nd_item<3> item_ct1, float f=.1) {} and with the declaration: args_selector<2, 1, decltype(foo)> selector(kernelParams, extra); void kernelParams[2 + 1] = { (void*)float2_var, int_var, float_var } we have: selector.get<0>() returns a reference to sycl::float*, selector.get<1>() returns a reference to int, selector.get<2>() returns a reference to float
Definition at line 952 of file util.hpp.
template<int n_nondefault_params, int n_default_params, typename R , typename... Ts>
If kernel_params is nonnull, then args_selector will extract arguments from kernel_params.
Otherwise, it will extract them from extra.
- Parameters
-
[in] | kernel_params | Array of pointers to arguments a or null pointer. |
[in] | extra | Array containing pointer to argument buffer. |
Definition at line 1014 of file util.hpp.