HEBench
hebench::cpp::BaseBenchmark Class Referenceabstract

Top level opaque benchmark class. More...

#include <benchmark.hpp>

Inheritance diagram for hebench::cpp::BaseBenchmark:
Collaboration diagram for hebench::cpp::BaseBenchmark:

Public Member Functions

 BaseBenchmark (BaseEngine &engine, const hebench::APIBridge::BenchmarkDescriptor &bench_desc, const hebench::APIBridge::WorkloadParams &bench_params)
 Constructs a new BaseBenchmark object for benchmarking a workload with flexible parameters. More...
 
 BaseBenchmark (BaseEngine &engine, const hebench::APIBridge::BenchmarkDescriptor &bench_desc)
 Constructs a new BaseBenchmark object for benchmarking a workload that does not have any flexible parameters. More...
 
virtual ~BaseBenchmark ()=default
 
virtual void initialize (const hebench::APIBridge::BenchmarkDescriptor &bench_desc_concrete)
 Called by Test Harness with the concrete values for the benchmark description. More...
 
virtual hebench::APIBridge::Handle encode (const hebench::APIBridge::DataPackCollection *p_parameters)=0
 
virtual void decode (hebench::APIBridge::Handle encoded_data, hebench::APIBridge::DataPackCollection *p_native)=0
 
virtual hebench::APIBridge::Handle encrypt (hebench::APIBridge::Handle encoded_data)=0
 
virtual hebench::APIBridge::Handle decrypt (hebench::APIBridge::Handle encrypted_data)=0
 
virtual hebench::APIBridge::Handle load (const hebench::APIBridge::Handle *p_local_data, std::uint64_t count)=0
 
virtual void store (hebench::APIBridge::Handle remote_data, hebench::APIBridge::Handle *p_local_data, std::uint64_t count)=0
 
virtual hebench::APIBridge::Handle operate (hebench::APIBridge::Handle h_remote_packed, const hebench::APIBridge::ParameterIndexer *p_param_indexers, std::uint64_t indexers_count)=0
 
BaseEnginegetEngine ()
 
const BaseEnginegetEngine () const
 
std::int64_t classTag () const override
 Retrieves the tag of the class to which this object belongs. More...
 
const hebench::APIBridge::BenchmarkDescriptorgetDescriptor () const
 
const std::vector< hebench::APIBridge::WorkloadParam > & getWorkloadParameters () const
 
- Public Member Functions inherited from hebench::cpp::ITaggedObject
 ITaggedObject ()
 
virtual ~ITaggedObject ()
 

Static Public Attributes

static constexpr std::int64_t tag = 0x4000000000000000
 Used to identify this class when returned as a handle to Test Harness. More...
 
- Static Public Attributes inherited from hebench::cpp::ITaggedObject
static constexpr std::int64_t MaskByteSet = 0xFF
 
static constexpr std::int64_t MaskReservedBits = MaskByteSet << 56
 Mask representing all bits reserved by C++ wrapper. More...
 

Protected Member Functions

void setDescriptor (const hebench::APIBridge::BenchmarkDescriptor &value)
 

Static Protected Member Functions

static std::uint64_t findDataPackIndex (const hebench::APIBridge::DataPackCollection &parameters, std::uint64_t param_position)
 Searches the specified DataPackCollection for the DataPack in the corresponding position. More...
 
static const hebench::APIBridge::DataPackfindDataPack (const hebench::APIBridge::DataPackCollection &parameters, std::uint64_t param_position)
 Searches the specified DataPackCollection for the DataPack in the corresponding position. More...
 
static hebench::APIBridge::DataPackfindDataPack (hebench::APIBridge::DataPackCollection &parameters, std::uint64_t param_position)
 Searches the specified DataPackCollection for the DataPack in the corresponding position. More...
 

Detailed Description

Top level opaque benchmark class.

This class hides the internal complexities of the backend operations from the API Bridge.

Definition at line 142 of file benchmark.hpp.

Constructor & Destructor Documentation

◆ BaseBenchmark() [1/2]

hebench::cpp::BaseBenchmark::BaseBenchmark ( BaseEngine engine,
const hebench::APIBridge::BenchmarkDescriptor bench_desc,
const hebench::APIBridge::WorkloadParams bench_params 
)

Constructs a new BaseBenchmark object for benchmarking a workload with flexible parameters.

Parameters
engineCalling engine.
[in]bench_descCalling description.
[in]bench_paramsParameters for this benchmark's workload.

Definition at line 59 of file benchmark.cpp.

◆ BaseBenchmark() [2/2]

hebench::cpp::BaseBenchmark::BaseBenchmark ( BaseEngine engine,
const hebench::APIBridge::BenchmarkDescriptor bench_desc 
)

Constructs a new BaseBenchmark object for benchmarking a workload that does not have any flexible parameters.

Parameters
engineCalling engine.
[in]bench_descCalling description.

Definition at line 52 of file benchmark.cpp.

◆ ~BaseBenchmark()

virtual hebench::cpp::BaseBenchmark::~BaseBenchmark ( )
virtualdefault

Member Function Documentation

◆ classTag()

std::int64_t hebench::cpp::BaseBenchmark::classTag ( ) const
inlineoverridevirtual

Retrieves the tag of the class to which this object belongs.

Most significant 8 bits of the 64-bit tag are reserved by C++ wrapper. See ITaggedObject for more details.

Implements hebench::cpp::ITaggedObject.

Definition at line 199 of file benchmark.hpp.

◆ decode()

virtual void hebench::cpp::BaseBenchmark::decode ( hebench::APIBridge::Handle  encoded_data,
hebench::APIBridge::DataPackCollection p_native 
)
pure virtual

◆ decrypt()

virtual hebench::APIBridge::Handle hebench::cpp::BaseBenchmark::decrypt ( hebench::APIBridge::Handle  encrypted_data)
pure virtual

◆ encode()

virtual hebench::APIBridge::Handle hebench::cpp::BaseBenchmark::encode ( const hebench::APIBridge::DataPackCollection p_parameters)
pure virtual

◆ encrypt()

virtual hebench::APIBridge::Handle hebench::cpp::BaseBenchmark::encrypt ( hebench::APIBridge::Handle  encoded_data)
pure virtual

◆ findDataPack() [1/2]

const hebench::APIBridge::DataPack & hebench::cpp::BaseBenchmark::findDataPack ( const hebench::APIBridge::DataPackCollection parameters,
std::uint64_t  param_position 
)
staticprotected

Searches the specified DataPackCollection for the DataPack in the corresponding position.

Parameters
[in]parametersDataPackCollection to search.
[in]param_positionComponent position of the DataPack to find inside parameters.
Returns
A reference to the DataPack inside parameters corresponding to the specified param_position.
Exceptions
hebench::cpp::HEBenchErrorif no DataPack for the specified param_position is found.

Definition at line 94 of file benchmark.cpp.

◆ findDataPack() [2/2]

hebench::APIBridge::DataPack & hebench::cpp::BaseBenchmark::findDataPack ( hebench::APIBridge::DataPackCollection parameters,
std::uint64_t  param_position 
)
staticprotected

Searches the specified DataPackCollection for the DataPack in the corresponding position.

Parameters
[in]parametersDataPackCollection to search.
[in]param_positionComponent position of the DataPack to find inside parameters.
Returns
A reference to the DataPack inside parameters corresponding to the specified param_position.
Exceptions
hebench::cpp::HEBenchErrorif no DataPack for the specified param_position is found.

Definition at line 104 of file benchmark.cpp.

◆ findDataPackIndex()

std::uint64_t hebench::cpp::BaseBenchmark::findDataPackIndex ( const hebench::APIBridge::DataPackCollection parameters,
std::uint64_t  param_position 
)
staticprotected

Searches the specified DataPackCollection for the DataPack in the corresponding position.

Parameters
[in]parametersDataPackCollection to search.
[in]param_positionComponent position of the DataPack to find inside parameters.
Returns
The index of the DataPack inside parameters corresponding to the specified param_position or parameters.pack_count if no DataPack for the specified param_position is found.

Definition at line 73 of file benchmark.cpp.

◆ getDescriptor()

const hebench::APIBridge::BenchmarkDescriptor& hebench::cpp::BaseBenchmark::getDescriptor ( ) const
inline

Definition at line 201 of file benchmark.hpp.

◆ getEngine() [1/2]

BaseEngine& hebench::cpp::BaseBenchmark::getEngine ( )
inline

Definition at line 196 of file benchmark.hpp.

◆ getEngine() [2/2]

const BaseEngine& hebench::cpp::BaseBenchmark::getEngine ( ) const
inline

Definition at line 197 of file benchmark.hpp.

◆ getWorkloadParameters()

const std::vector<hebench::APIBridge::WorkloadParam>& hebench::cpp::BaseBenchmark::getWorkloadParameters ( ) const
inline

Definition at line 202 of file benchmark.hpp.

◆ initialize()

void hebench::cpp::BaseBenchmark::initialize ( const hebench::APIBridge::BenchmarkDescriptor bench_desc_concrete)
virtual

Called by Test Harness with the concrete values for the benchmark description.

Parameters
[in]bench_desc_concreteBenchmark description with user-specified values properly assigned.

Functionally equivalent to hebench::APIBridge::initBenchmark().

Default implementation performs no operations and returns immediately. Override this method to add different behavior.

Definition at line 68 of file benchmark.cpp.

◆ load()

virtual hebench::APIBridge::Handle hebench::cpp::BaseBenchmark::load ( const hebench::APIBridge::Handle p_local_data,
std::uint64_t  count 
)
pure virtual

◆ operate()

virtual hebench::APIBridge::Handle hebench::cpp::BaseBenchmark::operate ( hebench::APIBridge::Handle  h_remote_packed,
const hebench::APIBridge::ParameterIndexer p_param_indexers,
std::uint64_t  indexers_count 
)
pure virtual

◆ setDescriptor()

void hebench::cpp::BaseBenchmark::setDescriptor ( const hebench::APIBridge::BenchmarkDescriptor value)
inlineprotected

Definition at line 237 of file benchmark.hpp.

◆ store()

virtual void hebench::cpp::BaseBenchmark::store ( hebench::APIBridge::Handle  remote_data,
hebench::APIBridge::Handle p_local_data,
std::uint64_t  count 
)
pure virtual

Member Data Documentation

◆ tag

constexpr std::int64_t hebench::cpp::BaseBenchmark::tag = 0x4000000000000000
staticconstexpr

Used to identify this class when returned as a handle to Test Harness.

See also
ITaggedObject

Definition at line 152 of file benchmark.hpp.


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