SkePU 0.7
include/skepu/src/operator_macros_cu.inl File Reference

Contains macro defintions for user functions using CUDA and CPU/OpenMP backend. More...

Defines

#define UNARY_FUNC(name, type1, param1, func)
#define UNARY_FUNC_CONSTANT(name, type1, param1, const1, func)
#define BINARY_FUNC(name, type1, param1, param2, func)
#define BINARY_FUNC_CONSTANT(name, type1, param1, param2, const1, func)
#define TERNARY_FUNC(name, type1, param1, param2, param3, func)
#define TERNARY_FUNC_CONSTANT(name, type1, param1, param2, param3, const1, func)
#define OVERLAP_FUNC(name, type1, over, param1, func)
#define OVERLAP_FUNC_STR(name, type1, over, param1, stride, func)
#define ARRAY_FUNC(name, type1, param1, param2, func)
#define ARRAY_FUNC_MATR(name, type1, param1, param2, func)
#define ARRAY_FUNC_MATR_CONST(name, type1, param1, param2, const1, const2, func)
#define GENERATE_FUNC(name, type1, index, const1, func)

Detailed Description

Contains macro defintions for user functions using CUDA and CPU/OpenMP backend.


Define Documentation

#define ARRAY_FUNC (   name,
  type1,
  param1,
  param2,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::ARRAY;\
    }\
    type1 CPU(type1 * param1, type1 param2)\
    {\
        func\
    }\
    __device__ type1 CU(type1 * param1, type1 param2)\
    {\
        func\
    }\
};

Macro defintion for Array user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used by the MapArray skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one. Can be accessed as an array in the body.
param2Name of parameter two. Only one element is accessible in the body.
funcFunction body.
#define ARRAY_FUNC_MATR (   name,
  type1,
  param1,
  param2,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    skepu::FuncType funcType;\
    int xindex;\
    int yindex;\
    name()\
    {\
        funcType = skepu::ARRAY;\
    }\
    type1 CPU(type1 * param1, type1 param2)\
    {\
        func\
    }\
    __device__ type1 CU(type1 * param1, type1 param2)\
    {\
        func\
    }\
    type1 CPU(type1 * param1, type1 param2, int xindex, int yindex)\
    {\
        func\
    }\
    __device__ type1 CU(type1 * param1, type1 param2, int xindex, int yindex)\
    {\
        func\
    }\
};

Macro defintion for Array user functions for Matrix. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used by the MapArray skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one. Can be accessed as an array in the body.
param2Name of parameter two. Only one element is accessible in the body.
funcFunction body.
#define ARRAY_FUNC_MATR_CONST (   name,
  type1,
  param1,
  param2,
  const1,
  const2,
  func 
)

Macro defintion for Array user functions for Matrix which also supports two constants. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used by the MapArray skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one. Can be accessed as an array in the body.
param2Name of parameter two. Only one element is accessible in the body.
const1Name of constant one which can be used in the body.
const1Name of constant two which can be used in the body.
funcFunction body.
#define BINARY_FUNC (   name,
  type1,
  param1,
  param2,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    bool isConst;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::BINARY;\
        isConst = false;\
    }\
    type1 dummy;\
    type1 getConstant() {return dummy;}\
    type1 CPU(type1 param1, type1 param2)\
    {\
        return CPU(param1, param2, dummy);\
    }\
    type1 CPU(type1 param1, type1 param2, type1 dummy)\
    {\
        func\
    }\
    __device__ type1 CU(type1 param1, type1 param2)\
    {\
        return CU(param1, param2, dummy);\
    }\
    __device__ type1 CU(type1 param1, type1 param2, type1 dummy)\
    {\
        func\
    }\
};

Macro defintion for Binary user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map, Reduce and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
param2Name of parameter two.
funcFunction body.
#define BINARY_FUNC_CONSTANT (   name,
  type1,
  param1,
  param2,
  const1,
  func 
)

Macro defintion for Binary user functions which also uses a constant. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
param2Name of parameter two.
const1Name of a constant which can be used in the body.
funcFunction body.
#define GENERATE_FUNC (   name,
  type1,
  index,
  const1,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::GENERATE;\
    }\
    type1 const1;\
    type1 getConstant() {return const1;}\
    void setConstant(type1 _v) {const1 = _v;}\
    type1 CPU(unsigned int index)\
    {\
        func\
    }\
    __device__ type1 CU(unsigned int index)\
    {\
        func\
    }\
};

Macro defintion for Generate user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used by the Generate skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
indexName of the index variable which will hold the index of the value to be generated.
const1Name of a constant which can be used in the body.
funcFunction body.
#define OVERLAP_FUNC (   name,
  type1,
  over,
  param1,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    int overlap;\
    int stride;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::OVERLAP;\
        overlap = over;\
        stride = 1;\
    }\
    int getStride() {return stride;}\
    void setStride(int _v) {stride = _v;}\
    type1 CPU(type1 * param1)\
    {\
        func\
    }\
    __device__ type1 CU(type1 * param1)\
    {\
        int stride=1;\
        func\
    }\
};

Macro defintion for Overlap user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used for MapOverlap skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
overThe overlap length used by the function.
param1Name of parameter one.
funcFunction body.
#define OVERLAP_FUNC_STR (   name,
  type1,
  over,
  param1,
  stride,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    int overlap;\
    int stride;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::OVERLAP;\
        overlap = over;\
    stride = 1;\
    }\
    int getStride() {return stride;}\
    void setStride(int _v) {stride = _v;}\
    type1 CPU(type1 * param1)\
    {\
        func\
    }\
    __device__ type1 CU(type1 * param1)\
    {\
        int stride=1;\
        func\
    }\
};

Macro defintion for Overlap user functions with support for strided access in body. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used for MapOverlap skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
overThe overlap length used by the function.
param1Name of parameter one.
stridethe stride which is used to access items column-wise.
funcFunction body.

Macro defintion for 2D Overlap user functions with support for strided access in function body. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can only be used with 2DMapOverlap skeleton.

Parameters:
nameFunction name.
type1Type of function parameters.
overXThe overlap length on horizontal axis used by the function.
overYThe overlap length on vertical axis used by the function.
param1Name of parameter one.
stridethe stride which is used to access items column-wise.
funcFunction body.
#define TERNARY_FUNC (   name,
  type1,
  param1,
  param2,
  param3,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    bool isConst;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::TERNARY;\
        isConst = false;\
    }\
    type1 dummy;\
    type1 getConstant() {return dummy;}\
    type1 CPU(type1 param1, type1 param2, type1 param3)\
    {\
        return CPU(param1, param2, param3, dummy);\
    }\
    type1 CPU(type1 param1, type1 param2, type1 param3, type1 dummy)\
    {\
        func\
    }\
    __device__ type1 CU(type1 param1, type1 param2, type1 param3)\
    {\
        return CU(param1, param2, param3, dummy);\
    }\
    __device__ type1 CU(type1 param1, type1 param2, type1 param3, type1 dummy)\
    {\
        func\
    }\
};

Macro defintion for Trinary user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
param2Name of parameter two.
param3Name of parameter three.
funcFunction body.
#define TERNARY_FUNC_CONSTANT (   name,
  type1,
  param1,
  param2,
  param3,
  const1,
  func 
)

Macro defintion for Trinary user functions which also uses a constant. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
param2Name of parameter two.
param3Name of parameter three.
const1Name of a constant which can be used in the body.
funcFunction body.
#define UNARY_FUNC (   name,
  type1,
  param1,
  func 
)
Value:
struct name\
{\
    typedef type1 TYPE;\
    bool isConst;\
    skepu::FuncType funcType;\
    name()\
    {\
        funcType = skepu::UNARY;\
        isConst = true;\
    }\
    type1 dummy;\
    type1 getConstant() {return dummy;}\
    type1 CPU(type1 param1)\
    {\
        return CPU(param1, dummy);\
    }\
    type1 CPU(type1 param1, type1 dummy)\
    {\
        func\
    }\
    __device__ type1 CU(type1 param1)\
    {\
        return CU(param1, dummy);\
    }\
    __device__ type1 CU(type1 param1, type1 dummy)\
    {\
        func\
    }\
};

Macro defintion for Unary user functions. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
funcFunction body.
#define UNARY_FUNC_CONSTANT (   name,
  type1,
  param1,
  const1,
  func 
)

Macro defintion for Unary user functions which also uses a constant. Includes both a CUDA variant (__device__ function) and a CPU variant also used for OpenMP. The defintion expands as a Struct which can be used when creating new skeletons. Can be used by the Map and MapReduce skeletons.

Parameters:
nameFunction name.
type1Type of function parameters.
param1Name of parameter one.
const1Name of a constant which can be used in the body.
funcFunction body.
 All Classes Namespaces Files Functions Enumerations Friends Defines