HEBench
hebench::TestHarness::DataGeneratorHelper Class Reference

Static helper class to generate vector data for all supported data types. More...

#include <datagen_helper.h>

Inheritance diagram for hebench::TestHarness::DataGeneratorHelper:

Public Member Functions

virtual ~DataGeneratorHelper ()=default
 

Static Public Member Functions

static void generateRandomVectorU (hebench::APIBridge::DataType data_type, void *result, std::uint64_t elem_count, double min_val, double max_val)
 Generates uniform random data of the specified type. More...
 
static void generateRandomVectorN (hebench::APIBridge::DataType data_type, void *result, std::uint64_t elem_count, double mean, double stddev)
 Generates normally distributed random data of the specified type. More...
 
static std::uint64_t generateRandomIntU (std::uint64_t min_val, std::uint64_t max_val)
 
static std::vector< std::uint64_t > generateRandomIntersectionIndicesU (std::uint64_t elem_count, std::uint64_t indices_count=0)
 Generates uniform random amount of indices. More...
 

Protected Member Functions

 DataGeneratorHelper ()=default
 

Detailed Description

Static helper class to generate vector data for all supported data types.

This class uses the default seed for generation to ensure repeatable results as long as parameters for the tests are the same.

Definition at line 61 of file datagen_helper.h.

Constructor & Destructor Documentation

◆ ~DataGeneratorHelper()

virtual hebench::TestHarness::DataGeneratorHelper::~DataGeneratorHelper ( )
virtualdefault

◆ DataGeneratorHelper()

hebench::TestHarness::DataGeneratorHelper::DataGeneratorHelper ( )
protecteddefault

Member Function Documentation

◆ generateRandomIntersectionIndicesU()

std::vector< std::uint64_t > hebench::TestHarness::DataGeneratorHelper::generateRandomIntersectionIndicesU ( std::uint64_t  elem_count,
std::uint64_t  indices_count = 0 
)
static

Generates uniform random amount of indices.

Parameters
[in]elem_countNumber of elements in the set.
[in]indices_countNumber of pre-defined indices to be generated.
Returns
A vector holding the indices.

Definition at line 161 of file datagen_helper.cpp.

◆ generateRandomIntU()

std::uint64_t hebench::TestHarness::DataGeneratorHelper::generateRandomIntU ( std::uint64_t  min_val,
std::uint64_t  max_val 
)
static

Definition at line 155 of file datagen_helper.cpp.

◆ generateRandomVectorN()

void hebench::TestHarness::DataGeneratorHelper::generateRandomVectorN ( hebench::APIBridge::DataType  data_type,
void *  result,
std::uint64_t  elem_count,
double  mean,
double  stddev 
)
static

Generates normally distributed random data of the specified type.

Parameters
[in]data_typeData type of data to generate.
[in]resultPointer to buffer containing elements of the specified type.
[in]elem_countNumber of elements in pointed buffer.
[in]min_valMinimum value for generated elements.
[in]max_valMaximum value for generated elements.

Definition at line 123 of file datagen_helper.cpp.

◆ generateRandomVectorU()

void hebench::TestHarness::DataGeneratorHelper::generateRandomVectorU ( hebench::APIBridge::DataType  data_type,
void *  result,
std::uint64_t  elem_count,
double  min_val,
double  max_val 
)
static

Generates uniform random data of the specified type.

Parameters
[in]data_typeData type of data to generate.
[in]resultPointer to buffer containing elements of the specified type.
[in]elem_countNumber of elements in pointed buffer.
[in]min_valMinimum value for generated elements.
[in]max_valMaximum value for generated elements.

Definition at line 91 of file datagen_helper.cpp.


The documentation for this class was generated from the following files: