HEBench
hebench::TestHarness::EltwiseAdd::Latency::Benchmark Class Referencefinal

#include <hebench_eltwiseadd_l.h>

Inheritance diagram for hebench::TestHarness::EltwiseAdd::Latency::Benchmark:
Collaboration diagram for hebench::TestHarness::EltwiseAdd::Latency::Benchmark:

Public Member Functions

 ~Benchmark () override=default
 
- Public Member Functions inherited from hebench::TestHarness::BenchmarkLatency
 ~BenchmarkLatency () override
 
bool run (hebench::Utilities::TimingReportEx &out_report, IBenchmark::RunConfig &config) override
 Executes the benchmark latency 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
 
std::uint32_t getEventIDNext ()
 Returns the next available event ID. 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

void init () override
 Initializes the partial benchmark members. More...
 
IDataLoader::Ptr getDataset () const override
 Dataset to be used for operations previously initialized during creation of this object. More...
 
std::uint32_t getEventIDStart () const override
 An ID to identify the first event during the benchmark run. More...
 
bool validateResult (IDataLoader::Ptr dataset, const std::uint64_t *param_data_pack_indices, const std::vector< hebench::APIBridge::NativeDataBuffer * > &p_outputs, hebench::APIBridge::DataType data_type) const override
 Validates the result of an operation against the ground truth. More...
 
- Protected Member Functions inherited from hebench::TestHarness::BenchmarkLatency
 BenchmarkLatency (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 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
 

Friends

class hebench::TestHarness::EltwiseAdd::Latency::BenchmarkDescriptor
 

Additional Inherited Members

- Public Types inherited from hebench::TestHarness::BenchmarkLatency
typedef std::shared_ptr< BenchmarkLatencyPtr
 
- 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
 

Detailed Description

Definition at line 53 of file hebench_eltwiseadd_l.h.

Constructor & Destructor Documentation

◆ ~Benchmark()

hebench::TestHarness::EltwiseAdd::Latency::Benchmark::~Benchmark ( )
overridedefault

Member Function Documentation

◆ getDataset()

IDataLoader::Ptr hebench::TestHarness::EltwiseAdd::Latency::Benchmark::getDataset ( ) const
inlineoverrideprotectedvirtual

Dataset to be used for operations previously initialized during creation of this object.

Returns
Dataset to be used for operations.

Implements hebench::TestHarness::PartialBenchmarkCategory.

Definition at line 68 of file hebench_eltwiseadd_l.h.

◆ getEventIDStart()

std::uint32_t hebench::TestHarness::EltwiseAdd::Latency::Benchmark::getEventIDStart ( ) const
inlineoverrideprotectedvirtual

An ID to identify the first event during the benchmark run.

Returns
ID of first event of the benchmark run.

All events in the execution of the benchmark will have an ID. The first event's ID will be this value. ID of subsequent events will be a value greater than this ID.

This is for report and display purposes only, so it matters not whether different benchmarks produce the same ID. If no override, it defaults to 0 for all derived classes.

Reimplemented from hebench::TestHarness::PartialBenchmark.

Definition at line 69 of file hebench_eltwiseadd_l.h.

◆ init()

void hebench::TestHarness::EltwiseAdd::Latency::Benchmark::init ( )
overrideprotectedvirtual

Initializes the partial benchmark members.

This method is provided to allow clients to perform polymorphic initialization outside of the class constructor before the backend benchmark is initialized. Unless an initialized backend benchmark is required, this is a good spot to perform dataset generation or loading for the benchmark to execute.

This method is called automatically during creation and initialization of the benchmark.

Implements hebench::TestHarness::PartialBenchmark.

Definition at line 122 of file hebench_eltwiseadd_l.cpp.

◆ validateResult()

bool hebench::TestHarness::EltwiseAdd::Latency::Benchmark::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
overrideprotectedvirtual

Validates the result of an operation against the ground truth.

Parameters
[in]datasetDataset containing the data for the operation performed.
[in]param_data_pack_indicesCollection of indices for data sample to use inside each parameter pack. See IDataLoader::getResultIndex().
[in]p_outputsPointer to the buffers containing the result of the operation to validate.
[in]data_typeData type of the data used in the operation.
Returns
true if result is valid.
false if result is not valid (or an std::exception descendant can be thrown in such case).

The number of buffers in vector p_outputs must be the same as the dimension of the ground truth result. It is expected that each buffer pointed by p_outputs is, at least, of the same size, in bytes, as the corresponding ground truth buffer.

Validation routine can either retrieve the ground truth result from dataset or compute it on the fly using the inputs from dataset pointed by param_data_pack_indices.

The default implementation provided assumes that dataset contains the results pre-computed and the data type for all arguments and results is data_type. If this is not the case for the derived class, clients should provide their own override version of this method.

Reimplemented from hebench::TestHarness::PartialBenchmarkCategory.

Definition at line 170 of file hebench_eltwiseadd_l.cpp.

Friends And Related Function Documentation

◆ hebench::TestHarness::EltwiseAdd::Latency::BenchmarkDescriptor


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