CUDPP 1.1.1
Static Public Member Functions
Operator< T, oper > Class Template Reference

Templatized operator class used by scan and segmented scan. More...

#include <cudpp_util.h>

List of all members.

Static Public Member Functions

static __device__ T op (const T a, const T b)
static __device__ T identity ()

Detailed Description

template<typename T, CUDPPOperator oper>
class Operator< T, oper >

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.


Member Function Documentation

template<typename T , CUDPPOperator oper>
static __device__ T Operator< T, oper >::op ( const T  a,
const T  b 
) [inline, static]

Applies the operator to operands a and b.

Parameters:
aFirst operand
bSecond operand
Returns:
a OP b, where OP is defined by CUDPPOperator oper.
template<typename T , CUDPPOperator oper>
static __device__ T Operator< T, oper >::identity ( ) [inline, static]

Returns the identity element defined for type T


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Defines