Template Offload class for CPU with CPU optimized OpenMP routines. More...
Public Member Functions | |
| template<class Container > | |
| void | arg_quantile_segment_indices (int64_t numSegments, const Container &inputContainer, int64_t parallelismSizeThreshold) |
| template<class Container > | |
| DType | cumulative_sum (const Container &inputContainer, int64_t parallelismSizeThreshold) |
| void | generate_priority_seeds (DType cumulativeSum, int64_t parallelismSizeThreshold, uint64_t startPoint=0.0) |
| Offload (int64_t bufferSize) | |
| void | reset () |
| template<class Container > | |
| void | shuffle (const Container &inputContainer, int64_t parallelismSizeThreshold, size_t numElements=-1) |
| ~Offload () | |
Data Fields | |
| std::vector< DType > | result |
| The vector to store final results. More... | |
Private Attributes | |
| float_t * | errorArray_ |
| Float pointer to an array to store random errors. More... | |
| uint64_t * | indexArray_ |
| Int64 pointer to an array to store indices. More... | |
| DType * | inputContainerData_ |
| DType pointer to an array to store input container's data to be processed. More... | |
| std::vector< int64_t > | priorityFrequencies_ |
| The Vector to store frequencies of each priority. This is used in Offload::arg_quantile_segment_indices method. More... | |
| std::vector< DType > | toShuffleVector_ |
| The Vector to store intermediate values to be shuffled. More... | |
| std::vector< DType > | uniquePriorities_ |
| The Vector to store unique priorities. This is used in Offload::arg_quantile_segment_indices method. More... | |
Template Offload class for CPU with CPU optimized OpenMP routines.
Constructor for Offload. Dynamically allocates required memory and initialises necessary variables.
Destructor for Offload. De-allocated all dynamically allocated memory.
| void Offload< DType >::arg_quantile_segment_indices | ( | int64_t | numSegments, |
| const Container & | inputContainer, | ||
| int64_t | parallelismSizeThreshold | ||
| ) |
The template method generates the quantile segments for given input container and the resulting indices of inputContainer from this operation is flushed into Offload::result.
Template Arguments
size method.| numSegments | : The number of segments to be divided inputContainer into. |
| inputContainer | : The input container which is to be divided into numSegments segments. |
| parallelismSizeThreshold | : The threshold size of inputContainer beyond which OpenMP parallelized routines are to be used. |
| DType Offload< DType >::cumulative_sum | ( | const Container & | inputContainer, |
| int64_t | parallelismSizeThreshold | ||
| ) |
This template method computes the cumulative sum of a given input container.
Template Arguments
size method.| inputContainer | : The input container for which sum has to be computed. |
| parallelismSizeThreshold | : The threshold size of inputContainer beyond which OpenMP parallelized routines are to be used. |
| void Offload< DType >::generate_priority_seeds | ( | DType | cumulativeSum, |
| int64_t | parallelismSizeThreshold, | ||
| uint64_t | startPoint = 0.0 |
||
| ) |
This method generates the priority seeds. This is used by C_Memory::sample when using proportional prioritization strategy. This method generates seeds between arguments startPoint and cumulativeSum. Results are flushed into Offload::result.
| cumulativeSum | : The cumulative sum upto which the seeds are to be generated. |
| parallelismSizeThreshold | : The threshold size of inputContainer beyond which OpenMP parallelized routines are to be used. |
| startPoint | : The start point, i.e. the smallest value of the generated seeds. |
| void Offload< DType >::reset |
Reset method for Offload. This will clear the Offload::result vector and fills it with 0.
| void Offload< DType >::shuffle | ( | const Container & | inputContainer, |
| int64_t | parallelismSizeThreshold, | ||
| size_t | numElements = -1 |
||
| ) |
This template method shuffles the given input container. Results are flushed into Offload::shuffle
Template Arguments
size method.| inputContainer | : The input container which has to be shuffled. |
| parallelismSizeThreshold | : The threshold size of inputContainer beyond which OpenMP parallelized routines are to be used. |
| numElements | : The number of elements in the inputContainer from the beginning to be shuffled. Default: -1, which will include all the elements of inputContainer. |
|
private |
Float pointer to an array to store random errors.
|
private |
Int64 pointer to an array to store indices.
|
private |
DType pointer to an array to store input container's data to be processed.
|
private |
The Vector to store frequencies of each priority. This is used in Offload::arg_quantile_segment_indices method.
| std::vector<DType> Offload< DType >::result |
The vector to store final results.
|
private |
The Vector to store intermediate values to be shuffled.
|
private |
The Vector to store unique priorities. This is used in Offload::arg_quantile_segment_indices method.