CUDPP 1.1.1
|
Templatized operator class used by scan and segmented scan. More...
#include <cudpp_util.h>
Static Public Member Functions | |
static __device__ T | op (const T a, const T b) |
static __device__ T | identity () |
Templatized operator class used by scan and segmented scan.
This Operator class is used to allow generic support of binary associative operators in scan. It defines two member functions, op() and identity(), that are used in place of + and 0 (for example) in the scan and segmented scan code. Because this is template code, all decisions in the code are made at compile time, resulting in optimal operator code. Currently the operators CUDPP_ADD, CUDPP_MULTIPLY, CUDPP_MIN, and CUDPP_MAX are supported. Operator is implemented using template specialization for the types int
, unsigned
int, and float
.
static __device__ T Operator< T, oper >::op | ( | const T | a, |
const T | b | ||
) | [inline, static] |
Applies the operator to operands a and b.
a | First operand |
b | Second operand |
static __device__ T Operator< T, oper >::identity | ( | ) | [inline, static] |
Returns the identity element defined for type T