HEBench
|
#include <hebench_benchmark_category.h>
Classes | |
class | RAIIHandle |
Public Types | |
typedef std::shared_ptr< PartialBenchmarkCategory > | Ptr |
Public Types inherited from hebench::TestHarness::PartialBenchmark | |
typedef std::shared_ptr< PartialBenchmark > | Ptr |
Public Types inherited from hebench::TestHarness::IBenchmark | |
typedef std::shared_ptr< IBenchmark > | Ptr |
Public Member Functions | |
~PartialBenchmarkCategory () override | |
Public Member Functions inherited from hebench::TestHarness::PartialBenchmark | |
~PartialBenchmark () override | |
std::weak_ptr< Engine > | getEngine () const override |
const hebench::APIBridge::Handle & | handle () 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 |
virtual bool | run (hebench::Utilities::TimingReportEx &out_report, RunConfig &config)=0 |
Executes the benchmark operations. More... | |
Protected Member Functions | |
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::Backend & | getBackendDescription () const |
Allows read-only access to this benchmark backend description. More... | |
const BenchmarkDescription::Configuration & | getBenchmarkConfiguration () const |
Allows read-only access to this benchmark configuration. More... | |
const BenchmarkDescription::Description & | getDescription () 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 | |
Definition at line 23 of file hebench_benchmark_category.h.
typedef std::shared_ptr<PartialBenchmarkCategory> hebench::TestHarness::PartialBenchmarkCategory::Ptr |
Definition at line 32 of file hebench_benchmark_category.h.
|
override |
Definition at line 90 of file hebench_benchmark_category.cpp.
|
protected |
Definition at line 84 of file hebench_benchmark_category.cpp.
|
protectedpure virtual |
Dataset to be used for operations previously initialized during creation of this object.
Implemented in hebench::TestHarness::SimpleSetIntersection::Offline::Benchmark, hebench::TestHarness::SimpleSetIntersection::Latency::Benchmark, hebench::TestHarness::MatrixMultiply::Offline::Benchmark, hebench::TestHarness::MatrixMultiply::Latency::Benchmark, hebench::TestHarness::LogisticRegression::Offline::Benchmark, hebench::TestHarness::LogisticRegression::Latency::Benchmark, hebench::TestHarness::GenericWL::Offline::Benchmark, hebench::TestHarness::GenericWL::Latency::Benchmark, hebench::TestHarness::EltwiseMult::Offline::Benchmark, hebench::TestHarness::EltwiseMult::Latency::Benchmark, hebench::TestHarness::EltwiseAdd::Offline::Benchmark, hebench::TestHarness::EltwiseAdd::Latency::Benchmark, hebench::TestHarness::DotProduct::Offline::Benchmark, and hebench::TestHarness::DotProduct::Latency::Benchmark.
|
protectedvirtual |
Outputs the arguments, expected ground truth, and received result to an output stream.
os | Stream where to write the log. | |
dataset | Dataset used for the operation. | |
[in] | param_data_pack_indices | Collection of indices for data sample to use inside each parameter pack. See IDataLoader::getResultIndex(). |
[in] | p_outputs | Pointer to the buffers containing the result of the operation to validate. |
[in] | data_type | Data type of the data used in the operation. |
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.
While not required, data output format should be a vector per column, for uniformity with default implementation. Utility function hebench::Utilities::printArraysAsColumns()
can help with column format printout.
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.
Definition at line 210 of file hebench_benchmark_category.cpp.
|
protectedvirtual |
Validates the result of an operation against the ground truth.
[in] | dataset | Dataset containing the data for the operation performed. |
[in] | param_data_pack_indices | Collection of indices for data sample to use inside each parameter pack. See IDataLoader::getResultIndex(). |
[in] | p_outputs | Pointer to the buffers containing the result of the operation to validate. |
[in] | data_type | Data type of the data used in the operation. |
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 in hebench::TestHarness::SimpleSetIntersection::Offline::Benchmark, hebench::TestHarness::SimpleSetIntersection::Latency::Benchmark, hebench::TestHarness::MatrixMultiply::Offline::Benchmark, hebench::TestHarness::MatrixMultiply::Latency::Benchmark, hebench::TestHarness::LogisticRegression::Offline::Benchmark, hebench::TestHarness::LogisticRegression::Latency::Benchmark, hebench::TestHarness::GenericWL::Offline::Benchmark, hebench::TestHarness::GenericWL::Latency::Benchmark, hebench::TestHarness::EltwiseMult::Offline::Benchmark, hebench::TestHarness::EltwiseMult::Latency::Benchmark, hebench::TestHarness::EltwiseAdd::Offline::Benchmark, hebench::TestHarness::EltwiseAdd::Latency::Benchmark, hebench::TestHarness::DotProduct::Offline::Benchmark, and hebench::TestHarness::DotProduct::Latency::Benchmark.
Definition at line 94 of file hebench_benchmark_category.cpp.