HEBench
hebench::cpp::WorkloadParams::Generic Class Reference

Wraps around flexible workload parameters required for a generic workload. More...

#include <workload_params.hpp>

Inheritance diagram for hebench::cpp::WorkloadParams::Generic:
Collaboration diagram for hebench::cpp::WorkloadParams::Generic:

Public Types

enum  : std::size_t { Index_N , Index_M }
 

Public Member Functions

const std::uint64_t & n () const
 Number of inputs to the operation. More...
 
const std::uint64_t & m () const
 Number of outputs from the operation. More...
 
std::uint64_t length_InputParam (std::size_t index) const
 Number of components in input vector at specified input index. More...
 
std::uint64_t & length_InputParam (std::size_t index)
 Number of elements in input vector at specified input index. More...
 
std::uint64_t length_ResultComponent (std::size_t index) const
 Number of elements in output vector at specified result index. More...
 
std::uint64_t & length_ResultComponent (std::size_t index)
 Number of elements in output vector at specified result index. More...
 
 Generic (std::uint64_t _n=1, std::uint64_t _m=1)
 Initializes a new object to represent workload parameters for a generic workload. More...
 
 Generic (const std::vector< hebench::APIBridge::WorkloadParam > &w_params)
 Initializes workload parameters for a generic workload from a list of existing workload parameters. More...
 
 Generic (const hebench::APIBridge::WorkloadParams &w_params)
 Initializes workload parameters for a generic workload from a list of existing workload parameters. More...
 
- Public Member Functions inherited from hebench::cpp::WorkloadParams::Common
 Common (std::size_t num_params=0)
 
 Common (const std::vector< hebench::APIBridge::WorkloadParam > &w_params)
 
 Common (const hebench::APIBridge::WorkloadParams &w_params)
 
virtual ~Common ()=default
 
template<typename T >
void add (const T &value, const std::string &name=std::string())
 Adds a new workload parameter to the list. More...
 
template<typename T >
void set (std::size_t index, const T &value, const std::string &name)
 Sets a new value for an existing workload parameter. More...
 
template<typename T >
void set (std::size_t index, const T &value)
 Sets a new value for an existing workload parameter. More...
 
template<typename T >
const T & get (std::size_t index) const
 Retrieves the value for an existing workload parameter. More...
 
const char * getName (std::size_t index) const
 
const std::vector< hebench::APIBridge::WorkloadParam > & getParams () const
 
template<>
void add (const double &value, const std::string &name)
 
template<>
void set (std::size_t index, const double &value, const std::string &name)
 
template<>
void set (std::size_t index, const double &value)
 
template<>
const double & get (std::size_t index) const
 

Additional Inherited Members

- Protected Attributes inherited from hebench::cpp::WorkloadParams::Common
std::vector< hebench::APIBridge::WorkloadParamm_w_params
 

Detailed Description

Wraps around flexible workload parameters required for a generic workload.

Definition at line 390 of file workload_params.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : std::size_t
Enumerator
Index_N 
Index_M 

Definition at line 393 of file workload_params.hpp.

Constructor & Destructor Documentation

◆ Generic() [1/3]

hebench::cpp::WorkloadParams::Generic::Generic ( std::uint64_t  _n = 1,
std::uint64_t  _m = 1 
)
inline

Initializes a new object to represent workload parameters for a generic workload.

Parameters
[in]_nNumber of inputs to the operation.
[in]_mNumber of outputs for the operation.

This constructor will generate workload parameters according to the specification for generic workload. Since ResultComponent and InputParam depend on m and n respectively, clients should utilize accessor methods provided in this class. Accessing and changing workload parameters through the base Generic interface is discouraged and should only be done for advanced processing: incorrectly modifying the workload parameters may cause undefined results.

Definition at line 466 of file workload_params.hpp.

◆ Generic() [2/3]

hebench::cpp::WorkloadParams::Generic::Generic ( const std::vector< hebench::APIBridge::WorkloadParam > &  w_params)
inline

Initializes workload parameters for a generic workload from a list of existing workload parameters.

Parameters
[in]w_paramsWorkload parameters from which to initialize. These will be copied to internal representation.
Exceptions
std::out_of_rangeif number of elements in w_params is not enough to contain all required generic workload parameters.
std::logic_errorif the type of any of the required parameters is incorrect.

Workloads of this type require, at least, m + n + 2 parameters as specified by their definition. If any of the parameters is missing or in the wrong format, a std::exception or derived type is thrown.

Definition at line 490 of file workload_params.hpp.

◆ Generic() [3/3]

hebench::cpp::WorkloadParams::Generic::Generic ( const hebench::APIBridge::WorkloadParams w_params)
inline

Initializes workload parameters for a generic workload from a list of existing workload parameters.

Parameters
[in]w_paramsWorkload parameters from which to initialize. These will be copied to internal representation.
Exceptions
std::out_of_rangeif number of elements in w_params is not enough to contain all required generic workload parameters.
std::logic_errorif the type of any of the required parameters is incorrect.

Workloads of this type require, at least, m + n + 2 parameters as specified by their definition. If any of the parameters is missing or in the wrong format, a std::exception or derived type is thrown.

Definition at line 509 of file workload_params.hpp.

Member Function Documentation

◆ length_InputParam() [1/2]

std::uint64_t& hebench::cpp::WorkloadParams::Generic::length_InputParam ( std::size_t  index)
inline

Number of elements in input vector at specified input index.

Parameters
[in]indexIndex of input component.

Definition at line 422 of file workload_params.hpp.

◆ length_InputParam() [2/2]

std::uint64_t hebench::cpp::WorkloadParams::Generic::length_InputParam ( std::size_t  index) const
inline

Number of components in input vector at specified input index.

Parameters
[in]indexIndex of input component.

Definition at line 411 of file workload_params.hpp.

◆ length_ResultComponent() [1/2]

std::uint64_t& hebench::cpp::WorkloadParams::Generic::length_ResultComponent ( std::size_t  index)
inline

Number of elements in output vector at specified result index.

Parameters
[in]indexIndex of result component.

Definition at line 444 of file workload_params.hpp.

◆ length_ResultComponent() [2/2]

std::uint64_t hebench::cpp::WorkloadParams::Generic::length_ResultComponent ( std::size_t  index) const
inline

Number of elements in output vector at specified result index.

Parameters
[in]indexIndex of result component.

Definition at line 433 of file workload_params.hpp.

◆ m()

const std::uint64_t& hebench::cpp::WorkloadParams::Generic::m ( ) const
inline

Number of outputs from the operation.

Definition at line 406 of file workload_params.hpp.

◆ n()

const std::uint64_t& hebench::cpp::WorkloadParams::Generic::n ( ) const
inline

Number of inputs to the operation.

Definition at line 402 of file workload_params.hpp.


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