HEBench
hebench::TestHarness::BenchmarkOffline Class Reference

Base class for workload benchmarks in the offline category. More...

#include <hebench_benchmark_offline.h>

Inheritance diagram for hebench::TestHarness::BenchmarkOffline:
Collaboration diagram for hebench::TestHarness::BenchmarkOffline:

Public Types

typedef std::shared_ptr< BenchmarkOfflinePtr
 
- Public Types inherited from hebench::TestHarness::PartialBenchmarkCategory
typedef std::shared_ptr< PartialBenchmarkCategoryPtr
 
- Public Types inherited from hebench::TestHarness::PartialBenchmark
typedef std::shared_ptr< PartialBenchmarkPtr
 
- Public Types inherited from hebench::TestHarness::IBenchmark
typedef std::shared_ptr< IBenchmarkPtr
 

Public Member Functions

 ~BenchmarkOffline () override
 
bool run (hebench::Utilities::TimingReportEx &out_report, IBenchmark::RunConfig &config) override
 Executes the benchmark offline test. More...
 
- Public Member Functions inherited from hebench::TestHarness::PartialBenchmarkCategory
 ~PartialBenchmarkCategory () override
 
- Public Member Functions inherited from hebench::TestHarness::PartialBenchmark
 ~PartialBenchmark () override
 
std::weak_ptr< EnginegetEngine () const override
 
const hebench::APIBridge::Handlehandle () const override
 
virtual std::uint32_t getEventIDStart () const
 An ID to identify the first event during the benchmark run. More...
 
std::uint32_t getEventIDNext ()
 Returns the next available event ID. More...
 
virtual void init ()=0
 Initializes the partial benchmark members. More...
 
void initBackend (hebench::Utilities::TimingReportEx &out_report, const FriendPrivateKey &)
 Initializes backend benchmark. More...
 
virtual void postInit ()
 Called automatically during initialization after the backend has been initialized. More...
 
void checkInitializationState (const FriendPrivateKey &) const
 Used to check that initialization steps have been completed successfully. More...
 
- Public Member Functions inherited from hebench::TestHarness::IBenchmark
virtual ~IBenchmark ()=default
 

Protected Member Functions

 BenchmarkOffline (std::shared_ptr< Engine > p_engine, const IBenchmarkDescriptor::DescriptionToken &description_token)
 
- Protected Member Functions inherited from hebench::TestHarness::PartialBenchmarkCategory
 PartialBenchmarkCategory (std::shared_ptr< Engine > p_engine, const IBenchmarkDescriptor::DescriptionToken &description_token)
 
virtual IDataLoader::Ptr getDataset () const =0
 Dataset to be used for operations previously initialized during creation of this object. More...
 
virtual bool validateResult (IDataLoader::Ptr dataset, const std::uint64_t *param_data_pack_indices, const std::vector< hebench::APIBridge::NativeDataBuffer * > &outputs, hebench::APIBridge::DataType data_type) const
 Validates the result of an operation against the ground truth. More...
 
virtual void logResult (std::ostream &os, IDataLoader::Ptr dataset, const std::uint64_t *param_data_pack_indices, const std::vector< hebench::APIBridge::NativeDataBuffer * > &outputs, hebench::APIBridge::DataType data_type) const
 Outputs the arguments, expected ground truth, and received result to an output stream. More...
 
- Protected Member Functions inherited from hebench::TestHarness::PartialBenchmark
const BenchmarkDescription::BackendgetBackendDescription () const
 Allows read-only access to this benchmark backend description. More...
 
const BenchmarkDescription::ConfigurationgetBenchmarkConfiguration () const
 Allows read-only access to this benchmark configuration. More...
 
const BenchmarkDescription::DescriptiongetDescription () const
 Allows read-only access to this benchmark text description. More...
 
 PartialBenchmark (std::shared_ptr< Engine > p_engine, const IBenchmarkDescriptor::DescriptionToken &description_token)
 
void validateRetCode (hebench::APIBridge::ErrorCode err_code, bool last_error=true) const
 Validates whether the specified HEBench API return code represents a success or error. More...
 
- Protected Member Functions inherited from hebench::TestHarness::IBenchmark
 IBenchmark ()=default
 

Detailed Description

Base class for workload benchmarks in the offline category.

This class offers an implementation to offline category benchmarking.

To extend this class, first clients must understand the execution flow as specified in IBenchmark interface. Then, see Adding Offline Category Using Pre-existing Implementation .

Definition at line 29 of file hebench_benchmark_offline.h.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ~BenchmarkOffline()

hebench::TestHarness::BenchmarkOffline::~BenchmarkOffline ( )
override

Definition at line 30 of file hebench_benchmark_offline.cpp.

◆ BenchmarkOffline()

hebench::TestHarness::BenchmarkOffline::BenchmarkOffline ( std::shared_ptr< Engine p_engine,
const IBenchmarkDescriptor::DescriptionToken description_token 
)
protected

Definition at line 24 of file hebench_benchmark_offline.cpp.

Member Function Documentation

◆ run()

bool hebench::TestHarness::BenchmarkOffline::run ( hebench::Utilities::TimingReportEx out_report,
IBenchmark::RunConfig config 
)
overridevirtual

Executes the benchmark offline test.

Parameters
out_reportObject where to append the report of the operation.
configSpecifies configuration parameters for the run.
Returns
true if benchmark succeeded and operation results were valid.
false if benchmark operation results were not valid.

In this implementation, validation failure is reported on the first result that fails validation.

  • Returns when no errors (true), or validation failed (false).
  • hebench::Common::ErrorException with backend error number attached if backend errors occur.
  • Throws std::exception (or derived exception other than hebench::Common::ErrorException) on any other errors.

Implements hebench::TestHarness::IBenchmark.

Definition at line 34 of file hebench_benchmark_offline.cpp.


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