When writing code for kernels, is it possible to specify a generic data type so that copying the kernel for each used data type is not necessary? Currently I'm using preprocessor macros to define the whole function with various data types:
#define REDUCTION(type) __kernel void reduce_##type##_f(__global __read_only type* a) \
{ \
// do something
} \
REDUCTION(float)
REDUCTION(float2)
This however is not very comfortable. Is there some type specifier like gentype
available?