31 "__kernel void UnaryMapKernel_KERNELNAME(__global TYPE* input, __global TYPE* output, unsigned int numElements, unsigned int offset1, unsigned int offset2, CONST_TYPE const1)\n"
33 " input = (__global void *)input + offset1; /* partitioning is special with opencl */ \n"
34 " output = (__global void *)output + offset2; /* partitioning is special with opencl */ \n"
35 " int i = get_global_id(0);\n"
36 " unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"
37 " while(i < numElements)\n"
39 " output[i] = FUNCTIONNAME(input[i], const1);\n"
50 "__kernel void BinaryMapKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n, unsigned int offset1, unsigned int offset2, unsigned int offset3, CONST_TYPE const1)\n"
52 " input1 = (__global void *)input1 + offset1; /* partitioning is special with opencl */ \n"
53 " input2 = (__global void *)input2 + offset2; /* partitioning is special with opencl */ \n"
54 " output = (__global void *)output + offset3; /* partitioning is special with opencl */ \n"
55 " int i = get_global_id(0);\n"
56 " unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"
59 " output[i] = FUNCTIONNAME(input1[i], input2[i], const1);\n"
70 "__kernel void TrinaryMapKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* input3, __global TYPE* output, unsigned int n, unsigned int offset1, unsigned int offset2, unsigned int offset3, unsigned int offset4, CONST_TYPE const1)\n"
72 " input1 = (__global void *)input1 + offset1; /* partitioning is special with opencl */ \n"
73 " input2 = (__global void *)input2 + offset2; /* partitioning is special with opencl */ \n"
74 " input3 = (__global void *)input3 + offset3; /* partitioning is special with opencl */ \n"
75 " output = (__global void *)output + offset4; /* partitioning is special with opencl */ \n"
76 " int i = get_global_id(0);\n"
77 " unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"
80 " output[i] = FUNCTIONNAME(input1[i], input2[i], input3[i], const1);\n"
108 template <
typename T,
typename U,
typename UnaryFunc>
109 __global__
void MapKernelUnary_CU(UnaryFunc mapFunc, T* input, T* output,
unsigned int n, U const1)
111 unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
112 unsigned int gridSize = blockDim.x*gridDim.x;
116 output[i] = mapFunc.CU(input[i], const1);
125 template <
typename T,
typename U,
typename BinaryFunc>
126 __global__
void MapKernelBinary_CU(BinaryFunc mapFunc, T* input1, T* input2, T* output,
unsigned int n, U const1)
128 unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
129 unsigned int gridSize = blockDim.x*gridDim.x;
133 output[i] = mapFunc.CU(input1[i], input2[i], const1);
142 template <
typename T,
typename U,
typename TrinaryFunc>
143 __global__
void MapKernelTrinary_CU(TrinaryFunc mapFunc, T* input1, T* input2, T* input3, T* output,
unsigned int n, U const1)
145 unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
146 unsigned int gridSize = blockDim.x*gridDim.x;
150 output[i] = mapFunc.CU(input1[i], input2[i], input3[i], const1);
__global__ void MapKernelUnary_CU(UnaryFunc mapFunc, T *input, T *output, unsigned int n, U const1)
Definition: map_kernels.h:109
static std::string UnaryMapKernel_CL("__kernel void UnaryMapKernel_KERNELNAME(__global TYPE* input, __global TYPE* output, unsigned int numElements, unsigned int offset1, unsigned int offset2, CONST_TYPE const1)\n""{\n"" input = (__global void *)input + offset1; /* partitioning is special with opencl */ \n"" output = (__global void *)output + offset2; /* partitioning is special with opencl */ \n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" while(i < numElements)\n"" {\n"" output[i] = FUNCTIONNAME(input[i], const1);\n"" i += gridSize;\n"" }\n""}\n")
__global__ void MapKernelBinary_CU(BinaryFunc mapFunc, T *input1, T *input2, T *output, unsigned int n, U const1)
Definition: map_kernels.h:126
__global__ void MapKernelTrinary_CU(TrinaryFunc mapFunc, T *input1, T *input2, T *input3, T *output, unsigned int n, U const1)
Definition: map_kernels.h:143
static std::string BinaryMapKernel_CL("__kernel void BinaryMapKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n, unsigned int offset1, unsigned int offset2, unsigned int offset3, CONST_TYPE const1)\n""{\n"" input1 = (__global void *)input1 + offset1; /* partitioning is special with opencl */ \n"" input2 = (__global void *)input2 + offset2; /* partitioning is special with opencl */ \n"" output = (__global void *)output + offset3; /* partitioning is special with opencl */ \n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" while(i < n)\n"" {\n"" output[i] = FUNCTIONNAME(input1[i], input2[i], const1);\n"" i += gridSize;\n"" }\n""}\n")
static std::string TrinaryMapKernel_CL("__kernel void TrinaryMapKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* input3, __global TYPE* output, unsigned int n, unsigned int offset1, unsigned int offset2, unsigned int offset3, unsigned int offset4, CONST_TYPE const1)\n""{\n"" input1 = (__global void *)input1 + offset1; /* partitioning is special with opencl */ \n"" input2 = (__global void *)input2 + offset2; /* partitioning is special with opencl */ \n"" input3 = (__global void *)input3 + offset3; /* partitioning is special with opencl */ \n"" output = (__global void *)output + offset4; /* partitioning is special with opencl */ \n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" while(i < n)\n"" {\n"" output[i] = FUNCTIONNAME(input1[i], input2[i], input3[i], const1);\n"" i += gridSize;\n"" }\n""}\n")