KernelArg
-
struct KernelArg
An argument that will be passed to a kernel. A
KernelArg
can either be:A scalar such as
int
,float
,double
, etc.An array consisting of a pointer value (e.g.,
int*
,float*
) and a length that indicates the number of elements of the array’s type.
This class contains method to construct
KernelArg
and to convert it back into C++ value. Useinto_kernel_arg
to convert a value intoKernelArg
.Public Functions
-
template<typename T>
inline T to() const Convert this
KernelArg
to a value of typeT
. Throws an exception if this value is not of typeT
.
-
Value to_value() const
Convert this
KernelArg
to aValue
. This is only valid for integer types (int
,long
,short
, etc) and floating-point types (float
,double
, etc). Throws an exception if the inner type of thisKernelArg
cannot is not an integer or floating-point type.