HEBench
hebench::Utilities Namespace Reference

Classes

struct  BenchmarkRequest
 
struct  BenchmarkSession
 
class  BenchmarkConfigLoader
 
class  BenchmarkConfigBroker
 Provides facilities to configure the selection of benchmarks to run based on the supported workloads from a loaded backend. More...
 
class  RandomGenerator
 
class  TimingReportEx
 
class  ConfigExporterImpl
 
class  ConfigImporterImpl
 

Functions

std::string convertToDirectoryName (const std::string &s, bool to_lowercase=true)
 Converts a string to directory name friendly. More...
 
void printArraysAsColumns (std::ostream &os, const hebench::APIBridge::NativeDataBuffer **p_buffers, std::size_t count, hebench::APIBridge::DataType data_type, bool output_row_index=false, const char *separator=" ")
 Writes the collection of NativeDataBuffer as columns to the specified output stream. More...
 
template<typename T >
void printArraysAsColumns (std::ostream &os, const hebench::APIBridge::NativeDataBuffer **p_buffers, std::size_t count, bool output_row_index=false, const char *separator=" ")
 Writes the collection of NativeDataBuffer as columns to the specified output stream. More...
 
template<>
std::string ConfigImporterImpl::retrieveValue< std::string > (const std::string &s_value)
 

Class Documentation

◆ hebench::Utilities::BenchmarkRequest

struct hebench::Utilities::BenchmarkRequest

Definition at line 29 of file hebench_config.h.

Collaboration diagram for hebench::Utilities::BenchmarkRequest:
Class Members
Configuration configuration
size_t index

◆ hebench::Utilities::BenchmarkSession

struct hebench::Utilities::BenchmarkSession

Definition at line 35 of file hebench_config.h.

Collaboration diagram for hebench::Utilities::BenchmarkSession:
Class Members
vector< BenchmarkRequest > benchmark_requests
vector< int8_t > data
uint64_t random_seed

Function Documentation

◆ ConfigImporterImpl::retrieveValue< std::string >()

template<>
std::string hebench::Utilities::ConfigImporterImpl::retrieveValue< std::string > ( const std::string &  s_value)
inline

Definition at line 125 of file hebench_config.cpp.

◆ convertToDirectoryName()

std::string hebench::Utilities::convertToDirectoryName ( const std::string &  s,
bool  to_lowercase = true 
)

Converts a string to directory name friendly.

Parameters
[in]sString to convert.
[in]to_lowercaseSpecifies whether to return all lowercase.
Returns
A string that can be used as a directory name.

This function will return a string generated from s where the result is composed only of alpha-numeric characters and non-repeating underscores. The result will have no leading or trailing underscores. If to_lowercase flag is true, all characters will lowercase, otherwise, they will keep the case originally encountered in s. Non-alpha-numeric characters will be turned into underscores.

For example:

s = "Hello, World!"
std::cout << convertToDirectoryName(s, true);
// Prints:
// hello_world
std::string convertToDirectoryName(const std::string &s, bool to_lowercase=true)
Converts a string to directory name friendly.

Definition at line 18 of file hebench_utilities_harness.cpp.

◆ printArraysAsColumns() [1/2]

template<typename T >
void hebench::Utilities::printArraysAsColumns ( std::ostream &  os,
const hebench::APIBridge::NativeDataBuffer **  p_buffers,
std::size_t  count,
bool  output_row_index = false,
const char *  separator = " " 
)

Writes the collection of NativeDataBuffer as columns to the specified output stream.

Parameters
osStream where to write.
[in]p_buffersArray of NativeDataBuffer where each element will be output per column. Each element does not need to have the same number of rows. It is assumed that buffers in this array point to data of type T.
[in]countNumber of elements in array p_buffers.
[in]separatorSeparator text to use when separating the columns.

The number of elements in each buffer pointed by p_buffers does not need to match. This method will print as many elements as each buffer has per row, so buffers with fewer elements will be skipped in the output after all their elements have been printed out.

Definition at line 17 of file hebench_utilities_harness.inl.

◆ printArraysAsColumns() [2/2]

void hebench::Utilities::printArraysAsColumns ( std::ostream &  os,
const hebench::APIBridge::NativeDataBuffer **  p_buffers,
std::size_t  count,
hebench::APIBridge::DataType  data_type,
bool  output_row_index = false,
const char *  separator = " " 
)

Writes the collection of NativeDataBuffer as columns to the specified output stream.

Parameters
osStream where to write.
[in]p_buffersArray of NativeDataBuffer where each element will be output per column. Each element does not need to have the same number of rows.
[in]countNumber of elements in array p_buffers.
[in]data_typeType of data pointed to by p_buffers ' NativeDataBuffer.
[in]separatorSeparator text to use when separating the columns.

The number of elements in each buffer pointed by p_buffers does not need to match. This method will print as many elements as each buffer has per row, so buffers with fewer elements will be skipped in the output after all their elements have been printed out.

Definition at line 52 of file hebench_utilities_harness.cpp.