KernelArg
-
struct KernelArg
An argument that will be passed to a kernel. A
KernelArgcan 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
KernelArgand to convert it back into C++ value. Useinto_kernel_argto convert a value intoKernelArg.Public Functions
-
template<typename T>
inline T to() const Convert this
KernelArgto a value of typeT. Throws an exception if this value is not of typeT.
-
Value to_value() const
Convert this
KernelArgto 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 thisKernelArgcannot is not an integer or floating-point type.