The base strategy class. More...
#include <parallel_reduce.h>

Public Member Functions | |
| bool | clearReduceBuffers () |
| int | getBodyAlignment () const |
| int | getBodyOffsetStride () const |
| int | getBodySize () const |
| int | getBodySizeWithReduction () const |
| int | getBodyStride () const |
| int | getFinalIndex (int baseBodyIndex, int bodyOffset) |
| Computes the final index for a given body index into the body reduction buffer. | |
| virtual ReduceType | getType () const |
| Virtual function indicating the type of strategy. | |
| virtual void | initialize (int bodySize, int maxBodyRepetitionCount, const IntVector &batchRepetitionCount) |
| Virtual function that initializes the strategy. Essentially, this is where the strides/sizes are deteremined. | |
| void | print () |
| ReduceStrategy () | |
| Constructs an instance of the base strategy. | |
| void | setBodyAlignment (int bodyAlignment) |
| Sets the alignment for the number of bodies, e.g., 16/32/64. | |
| void | setClearReduceBuffers (bool clearBuffers) |
| Sets whether the reduction kernel should clear the reduction buffer after the reduce operation. | |
| virtual | ~ReduceStrategy () |
| Destroys the strategy. | |
Protected Member Functions | |
| void | setBodyOffsetStride (int bodyStride) |
| void | setBodySize (int bodySize) |
| void | setBodySizeWithReduction (int bodySize) |
| void | setBodyStride (int bodyStride) |
Private Attributes | |
| bool | bClearReduceBuffers_ |
| int | bodyAlignment_ |
| int | bodyOffsetStride_ |
| int | bodySize_ |
| int | bodySizeWithReduction_ |
| int | bodyStride_ |
The base strategy class.
This class is little more than a wrapper that assists the reduction kernel in determing the stride and offsets between body reduction entries in the reduction buffer.
Definition at line 25 of file parallel_reduce.h.
| parallel_ode::ReduceStrategy::ReduceStrategy | ( | ) | [inline] |
Constructs an instance of the base strategy.
Definition at line 32 of file parallel_reduce.h.
| virtual parallel_ode::ReduceStrategy::~ReduceStrategy | ( | ) | [inline, virtual] |
Destroys the strategy.
Definition at line 43 of file parallel_reduce.h.
| bool parallel_ode::ReduceStrategy::clearReduceBuffers | ( | ) | [inline] |
Definition at line 91 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getBodyAlignment | ( | ) | const [inline] |
Definition at line 85 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getBodyOffsetStride | ( | ) | const [inline] |
Definition at line 89 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getBodySize | ( | ) | const [inline] |
Definition at line 86 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getBodySizeWithReduction | ( | ) | const [inline] |
Definition at line 87 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getBodyStride | ( | ) | const [inline] |
Definition at line 88 of file parallel_reduce.h.
| int parallel_ode::ReduceStrategy::getFinalIndex | ( | int | baseBodyIndex, | |
| int | bodyOffset | |||
| ) | [inline] |
Computes the final index for a given body index into the body reduction buffer.
| baseBodyIndex | The base index for the given body | |
| bodyOffset | The repetition number of this particular body within the batch |
Definition at line 83 of file parallel_reduce.h.
| virtual ReduceType parallel_ode::ReduceStrategy::getType | ( | ) | const [inline, virtual] |
Virtual function indicating the type of strategy.
Reimplemented in parallel_ode::SequentialReduceStrategy, parallel_ode::StridedReduceStrategy, and parallel_ode::CompactReduceStrategy.
Definition at line 59 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::initialize | ( | int | bodySize, | |
| int | maxBodyRepetitionCount, | |||
| const IntVector & | batchRepetitionCount | |||
| ) | [virtual] |
Virtual function that initializes the strategy. Essentially, this is where the strides/sizes are deteremined.
| bodySize | The number of bodies | |
| maxBodyRepetitionCount | The maximum number of times a body is repeated for all batches | |
| batchRepetitionCount | The maximum number of times a body is repeated in each batch |
Reimplemented in parallel_ode::SequentialReduceStrategy, parallel_ode::StridedReduceStrategy, and parallel_ode::CompactReduceStrategy.
Definition at line 11 of file parallel_reduce.cpp.
| void parallel_ode::ReduceStrategy::print | ( | ) | [inline] |
Definition at line 93 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setBodyAlignment | ( | int | bodyAlignment | ) | [inline] |
Sets the alignment for the number of bodies, e.g., 16/32/64.
| bodyAlignment | The body alignment |
Definition at line 66 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setBodyOffsetStride | ( | int | bodyStride | ) | [inline, protected] |
Definition at line 101 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setBodySize | ( | int | bodySize | ) | [inline, protected] |
Definition at line 98 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setBodySizeWithReduction | ( | int | bodySize | ) | [inline, protected] |
Definition at line 99 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setBodyStride | ( | int | bodyStride | ) | [inline, protected] |
Definition at line 100 of file parallel_reduce.h.
| void parallel_ode::ReduceStrategy::setClearReduceBuffers | ( | bool | clearBuffers | ) | [inline] |
Sets whether the reduction kernel should clear the reduction buffer after the reduce operation.
| clearBuffers | Boolean indicating whether to clear or not |
Definition at line 73 of file parallel_reduce.h.
bool parallel_ode::ReduceStrategy::bClearReduceBuffers_ [private] |
Indicates whether the reduction kernel should zero out the reduction buffers
Definition at line 111 of file parallel_reduce.h.
int parallel_ode::ReduceStrategy::bodyAlignment_ [private] |
# of bodies per memory aligned stride ( 128 bytes typically )
Definition at line 105 of file parallel_reduce.h.
int parallel_ode::ReduceStrategy::bodyOffsetStride_ [private] |
Stride between entires for the same body in the reduction buffer
Definition at line 109 of file parallel_reduce.h.
int parallel_ode::ReduceStrategy::bodySize_ [private] |
Total # of bodies
Definition at line 106 of file parallel_reduce.h.
int parallel_ode::ReduceStrategy::bodySizeWithReduction_ [private] |
Total # of body reduction entries
Definition at line 107 of file parallel_reduce.h.
int parallel_ode::ReduceStrategy::bodyStride_ [private] |
Stride between successive bodies in the reduction buffer
Definition at line 108 of file parallel_reduce.h.