SkePU(integratedwithStarPU)  0.8.1
 All Classes Namespaces Files Functions Enumerations Friends Macros Groups Pages
Functions
MapArray Kernels
Collaboration diagram for MapArray Kernels:

Functions

static std::string skepu::MapArrayKernel_CL ("__kernel void MapArrayKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n)\n""{\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[0], input2[i]);\n"" i += gridSize;\n"" }\n""}\n")
 
static std::string skepu::MapArrayKernel_CL_Matrix ("__kernel void MapArrayKernel_Matrix_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n, unsigned int xsize, unsigned int ysize, int yoffset, CONST_TYPE const1)\n""{\n"" int xindex = get_global_id(0);\n"" int yindex = get_global_id(1);\n"" int i = yindex*xsize + xindex; \n"" if(i < n && xindex<xsize && yindex <ysize)\n"" {\n"" output[i] = FUNCTIONNAME(&input1[0], input2[i], xindex, yindex+yoffset, const1);\n"" }\n""}\n")
 
static std::string skepu::MapArrayKernel_CL_Matrix_Blockwise ("__kernel void MapArrayKernel_Matrix_Blockwise_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int outSize, int p2BlockSize, CONST_TYPE const1)\n""{\n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" if(i < outSize)\n"" {\n"" output[i] = FUNCTIONNAME(&input1[0], &input2[i*p2BlockSize], const1);\n"" i += gridSize;\n"" }\n""}\n")
 
static std::string skepu::MapArrayKernel_CL_Sparse_Matrix_Blockwise ("__kernel void MapArrayKernel_Sparse_Matrix_Blockwise_KERNELNAME(__global TYPE* input1, __global TYPE* in2_values, __global unsigned int *in2_row_offsets, __global unsigned int *in2_col_indices, __global TYPE* output, unsigned int outSize, int indexOffset, CONST_TYPE const1)\n""{\n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" if(i < outSize)\n"" {\n"" int rowId = in2_row_offsets[i] - indexOffset;\n"" int row2Id = in2_row_offsets[i+1] - indexOffset;\n"" output[i] = FUNCTIONNAME(&input1[0], &in2_values[rowId], (row2Id-rowId), &in2_col_indices[rowId], const1);\n"" i += gridSize;\n"" }\n""}\n")
 
template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU (ArrayFunc mapArrayFunc, T *input1, T *input2, T *output, unsigned int n)
 
template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Matrix (ArrayFunc mapArrayFunc, T *input1, T *input2, T *output, unsigned int n, unsigned int xsize, unsigned int ysize, unsigned int yoffset)
 
template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Matrix_Blockwise (ArrayFunc mapArrayFunc, T *input1, T *input2, T *output, unsigned int outSize, int p2BlockSize)
 
template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Sparse_Matrix_Blockwise (ArrayFunc mapArrayFunc, T *input1, T *in2_values, unsigned int *in2_row_offsets, unsigned int *in2_col_indices, T *output, unsigned int outSize, int indexOffset)
 

Detailed Description

Definitions of CUDA and OpenCL kernels for the Map skeleton.

Function Documentation

static std::string skepu::MapArrayKernel_CL ( "__kernel void MapArrayKernel_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n)\n""{\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[0], input2[i]);\n"" i += gridSize;\n"" }\n""}\n"  )
static

OpenCL MapArray kernel. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

static std::string skepu::MapArrayKernel_CL_Matrix ( "__kernel void MapArrayKernel_Matrix_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int n, unsigned int xsize, unsigned int ysize, int yoffset, CONST_TYPE const1)\n""{\n"" int xindex = get_global_id(0);\n"" int yindex = get_global_id(1);\n"" int i = yindex*xsize + xindex; \n"" if(i < n && xindex<xsize && yindex <ysize)\n"" {\n"" output[i] = FUNCTIONNAME(&input1[0], input2[i], xindex, yindex+yoffset, const1);\n"" }\n""}\n"  )
static

OpenCL MapArray kernel for Vector-Matrix. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

static std::string skepu::MapArrayKernel_CL_Matrix_Blockwise ( "__kernel void MapArrayKernel_Matrix_Blockwise_KERNELNAME(__global TYPE* input1, __global TYPE* input2, __global TYPE* output, unsigned int outSize, int p2BlockSize, CONST_TYPE const1)\n""{\n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" if(i < outSize)\n"" {\n"" output[i] = FUNCTIONNAME(&input1[0], &input2[i*p2BlockSize], const1);\n"" i += gridSize;\n"" }\n""}\n"  )
static

OpenCL MapArray kernel for Vector-Matrix that applies array block-wise. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

static std::string skepu::MapArrayKernel_CL_Sparse_Matrix_Blockwise ( "__kernel void MapArrayKernel_Sparse_Matrix_Blockwise_KERNELNAME(__global TYPE* input1, __global TYPE* in2_values, __global unsigned int *in2_row_offsets, __global unsigned int *in2_col_indices, __global TYPE* output, unsigned int outSize, int indexOffset, CONST_TYPE const1)\n""{\n"" int i = get_global_id(0);\n"" unsigned int gridSize = get_local_size(0)*get_num_groups(0);\n"" if(i < outSize)\n"" {\n"" int rowId = in2_row_offsets[i] - indexOffset;\n"" int row2Id = in2_row_offsets[i+1] - indexOffset;\n"" output[i] = FUNCTIONNAME(&input1[0], &in2_values[rowId], (row2Id-rowId), &in2_col_indices[rowId], const1);\n"" i += gridSize;\n"" }\n""}\n"  )
static

OpenCL MapArray kernel for Vector-SparseMatrix that applies array block-wise. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU ( ArrayFunc  mapArrayFunc,
T *  input1,
T *  input2,
T *  output,
unsigned int  n 
)

CUDA MapArray kernel. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Matrix ( ArrayFunc  mapArrayFunc,
T *  input1,
T *  input2,
T *  output,
unsigned int  n,
unsigned int  xsize,
unsigned int  ysize,
unsigned int  yoffset 
)

CUDA MapArray kernel for Vector-Matrix. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Matrix_Blockwise ( ArrayFunc  mapArrayFunc,
T *  input1,
T *  input2,
T *  output,
unsigned int  outSize,
int  p2BlockSize 
)

CUDA MapArray kernel for Vector-Matrix that applies array block-wise. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.

template<typename T , typename ArrayFunc >
__global__ void skepu::MapArrayKernel_CU_Sparse_Matrix_Blockwise ( ArrayFunc  mapArrayFunc,
T *  input1,
T *  in2_values,
unsigned int *  in2_row_offsets,
unsigned int *  in2_col_indices,
T *  output,
unsigned int  outSize,
int  indexOffset 
)

CUDA MapArray kernel for Vector-SparseMatrix that applies array block-wise. Similar to Map computation but a pointer to first vector is supplied to the user function instead of just one element.