User`s guide

9 GPU Computing
9-22
k = parallel.gpu.CUDAKernel('myfun.ptx','float *, const float *, float');
Another use for C prototype input is when your source code uses an unrecognized
renaming of a supported data type. (See the supported types below.) Suppose your kernel
comprises the following code.
typedef float ArgType;
__global__ void add3( ArgType * v1, const ArgType * v2 )
{
int idx = threadIdx.x;
v1[idx] += v2[idx];
}
ArgType itself is not recognized as a supported data type, so the CU file that includes
it cannot be directly used as input when creating the CUDAKernel object in MATLAB.
However, the supported input types to the add3 kernel can be specified as C prototype
input to the CUDAKernel constructor. For example:
k = parallel.gpu.CUDAKernel('test.ptx','float *, const float *','add3');
Supported Data Types
The supported C/C++ standard data types are listed in the following table.
Float Types Integer Types Boolean and Character Types
double, double2
float, float2
short, unsigned short,
short2, ushort2
int, unsigned int, int2,
uint2
long, unsigned long,
long2, ulong2
long long, unsigned
long long, longlong2,
ulonglong2
ptrdiff_t, size_t
bool
char, unsigned char,
char2, uchar2
Also, the following integer types are supported when you include the tmwtypes.h header
file in your program.