HClib  0.3
Documentation for Habanero-C Library API
 All Data Structures Functions Typedefs Enumerations Groups
Data Structures | Enumerations | Functions
Accumulators

Accumulator API for reductions. More...

Data Structures

struct  accum_t
 Opaque type for accumulators. More...
 
struct  accumed_t
 Accumed clause. User-level data-structure to represent an accumulator clause. More...
 

Enumerations

enum  accum_op_t {
  ACCUM_OP_NONE, ACCUM_OP_PLUS, ACCUM_OP_PROD, ACCUM_OP_MIN,
  ACCUM_OP_MAX, ACCUM_OP_LAND, ACCUM_OP_BAND, ACCUM_OP_LOR,
  ACCUM_OP_BOR, ACCUM_OP_LXOR, ACCUM_OP_BXOR
}
 Runtime-supported accumulator operations.
 
enum  accum_mode_t { ACCUM_MODE_SEQ, ACCUM_MODE_LAZY, ACCUM_MODE_REC }
 Accumulators' reduction modes. To specify the accumulation strategy an accumulator is backed by.
 

Functions

void accum_register (accum_t **accs, int n)
 Register a list of accumulators in the current finish scope. More...
 
accum_taccum_create_int (accum_op_t op, accum_mode_t mode, int init)
 Allocate and initialize an 'int' accumulator. More...
 
int accum_get_int (accum_t *acc)
 Get the value of an accumulator. More...
 
void accum_put_int (accum_t *acc, int v)
 Contribute a value to an accumulator. More...
 
accum_taccum_create_double (accum_op_t op, accum_mode_t mode, double init)
 Allocate and initialize a 'double' accumulator. More...
 
double accum_get_double (accum_t *acc)
 Get the value of an accumulator. More...
 
void accum_put_double (accum_t *acc, double v)
 Contribute a value to an accumulator. More...
 
void accum_destroy (accum_t *acc)
 Destroy an accumulator. More...
 

Detailed Description

Accumulator API for reductions.

Function Documentation

accum_t* accum_create_double ( accum_op_t  op,
accum_mode_t  mode,
double  init 
)

Allocate and initialize a 'double' accumulator.

Parameters
[in]opOperation to apply on reduction
[in]modeAccumulator backend implementation
[in]initInitial value of the accumulator
Returns
A contiguous array of DDFs

Definition at line 853 of file accumulator.c.

accum_t* accum_create_int ( accum_op_t  op,
accum_mode_t  mode,
int  init 
)

Allocate and initialize an 'int' accumulator.

Parameters
[in]opOperation to apply on reduction
[in]modeAccumulator backend implementation
[in]initInitial value of the accumulator
Returns
A contiguous array of DDFs

Definition at line 619 of file accumulator.c.

void accum_destroy ( accum_t acc)

Destroy an accumulator.

Parameters
[in]accThe accumulator to destroy

Definition at line 987 of file accumulator.c.

double accum_get_double ( accum_t acc)

Get the value of an accumulator.

Parameters
[in]accThe accumulator to get the value from
Returns
Current accumulator's value

Definition at line 963 of file accumulator.c.

int accum_get_int ( accum_t acc)

Get the value of an accumulator.

Parameters
[in]accThe accumulator to get the value from
Returns
Current accumulator's value

Definition at line 933 of file accumulator.c.

void accum_put_double ( accum_t acc,
double  v 
)

Contribute a value to an accumulator.

Parameters
[in]accThe accumulator to put a value
[in]vThe value to accumulate

Definition at line 968 of file accumulator.c.

void accum_put_int ( accum_t acc,
int  v 
)

Contribute a value to an accumulator.

Parameters
[in]accThe accumulator to put a value
[in]vThe value to accumulate

Definition at line 938 of file accumulator.c.

void accum_register ( accum_t **  accs,
int  n 
)

Register a list of accumulators in the current finish scope.

Parameters
[in]accsThe accumulator list to register
[in]vThe size of the list Warning/Limitation: this overwrites currently registered accum

Definition at line 973 of file accumulator.c.