HEBench
hebench::TestHarness::IBenchmark Class Referenceabstract

Interface for benchmarks. More...

#include <hebench_ibenchmark.h>

Inheritance diagram for hebench::TestHarness::IBenchmark:

Classes

struct  RunConfig
 Provides configuration to and retrieves data from a benchmark run. More...
 

Public Types

typedef std::shared_ptr< IBenchmarkPtr
 

Public Member Functions

virtual ~IBenchmark ()=default
 
virtual bool run (hebench::Utilities::TimingReportEx &out_report, RunConfig &config)=0
 Executes the benchmark operations. More...
 
virtual std::weak_ptr< EnginegetEngine () const =0
 
virtual const hebench::APIBridge::Handlehandle () const =0
 

Protected Member Functions

 IBenchmark ()=default
 

Detailed Description

Interface for benchmarks.

To implement this interface and create workloads, it is easier to extend directly from the workload category benchmark classes BenchmarkLatency, BenchmarkOffline, etc. If more control or specific processing other than the generic category execution is needed, extending from PartialBenchmark offers more flexibility.

Definition at line 439 of file hebench_ibenchmark.h.


Class Documentation

◆ hebench::TestHarness::IBenchmark::RunConfig

struct hebench::TestHarness::IBenchmark::RunConfig

Provides configuration to and retrieves data from a benchmark run.

Definition at line 452 of file hebench_ibenchmark.h.

Class Members
bool b_validate_results Specifies whether the benchmark will validate backend results (true) or it will simply benchmark without validating (false).

Shutting down validation can be useful when re-running benchmarks that have been already validated or when creating and debugging new backends.

Member Typedef Documentation

◆ Ptr

Definition at line 448 of file hebench_ibenchmark.h.

Constructor & Destructor Documentation

◆ ~IBenchmark()

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

◆ IBenchmark()

hebench::TestHarness::IBenchmark::IBenchmark ( )
protecteddefault

Member Function Documentation

◆ getEngine()

virtual std::weak_ptr<Engine> hebench::TestHarness::IBenchmark::getEngine ( ) const
pure virtual

◆ handle()

virtual const hebench::APIBridge::Handle& hebench::TestHarness::IBenchmark::handle ( ) const
pure virtual

◆ run()

virtual bool hebench::TestHarness::IBenchmark::run ( hebench::Utilities::TimingReportEx out_report,
RunConfig config 
)
pure virtual

Executes the benchmark operations.

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.

Convention:

  • 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.

Implemented in hebench::TestHarness::BenchmarkOffline, and hebench::TestHarness::BenchmarkLatency.


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