HEBench
|
Base interface for Benchmark Descriptors. More...
#include <hebench_ibenchmark.h>
Classes | |
class | DescriptionToken |
Token returned by a successful call to IBenchmarkDescriptor::matchBenchmarkDescriptor(). More... | |
Public Member Functions | |
IBenchmarkDescriptor ()=default | |
virtual | ~IBenchmarkDescriptor ()=default |
virtual DescriptionToken::Ptr | matchDescriptor (const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config) const =0 |
Determines if the represented benchmark can perform the workload described by a specified HEBench benchmark descriptor and configuration. More... | |
virtual PartialBenchmark * | createBenchmark (std::shared_ptr< Engine > p_engine, const DescriptionToken &description_token)=0 |
Creates the represented IBenchmark object that can perform the workload specified by the HEBench benchmark descriptor. More... | |
virtual void | destroyBenchmark (PartialBenchmark *p_bench)=0 |
Destroys an object returned by createBenchmark() . More... | |
Protected Member Functions | |
DescriptionToken::Ptr | createToken (const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config, const BenchmarkDescription::Description &text_desc) const |
Creates a DescriptionToken object associated to this IBenchmarkDescription object using the specified benchmark description. More... | |
Base interface for Benchmark Descriptors.
Benchmark Descriptors are lightweight classes that represent a benchmark or collection of benchmarks that can be executed. For each supported benchmark, a corresponding Benchmark Descriptor is registered with the BenchmarkFactory.
During benchmark selection, BenchmarkFactory polls every registered Benchmark Descriptor whether their represented benchmark can execute the benchmark described by a backend. Once a descriptor is matched, it is responsible for creating its represented benchmark object. Once the benchmark completes, the same descriptor is tasked with destroying it.
Clients should extend PartialBenchmarkDescriptor class when creating their descriptors instead of this interface.
Definition at line 43 of file hebench_ibenchmark.h.
|
default |
|
virtualdefault |
|
pure virtual |
Creates the represented IBenchmark object that can perform the workload specified by the HEBench benchmark descriptor.
[in] | p_engine | The engine creating the benchmark. |
[in] | description_token | Description token describing the benchmark to create, as matched by matchBenchmarkDescriptor(). |
IBenchmark
that can perform the specified workload or null
on unknown error.Instead of returning null
, this method may also throw instances of std::exception
to communicate errors to caller with better error descriptions.
This method constructs an object of type derived from IBenchmark, performs any pending initialization on the fully constructed object, and returns a pointer to it. The returned pointer must live until passed to method destroyBenchmark()
.
Implemented in hebench::TestHarness::SimpleSetIntersection::Offline::BenchmarkDescriptor, hebench::TestHarness::SimpleSetIntersection::Latency::BenchmarkDescriptor, hebench::TestHarness::MatrixMultiply::Offline::BenchmarkDescriptor, hebench::TestHarness::MatrixMultiply::Latency::BenchmarkDescriptor, hebench::TestHarness::LogisticRegression::Offline::BenchmarkDescriptor, hebench::TestHarness::LogisticRegression::Latency::BenchmarkDescriptor, hebench::TestHarness::GenericWL::Offline::BenchmarkDescriptor, hebench::TestHarness::GenericWL::Latency::BenchmarkDescriptor, hebench::TestHarness::EltwiseMult::Offline::BenchmarkDescriptor, hebench::TestHarness::EltwiseMult::Latency::BenchmarkDescriptor, hebench::TestHarness::EltwiseAdd::Offline::BenchmarkDescriptor, hebench::TestHarness::EltwiseAdd::Latency::BenchmarkDescriptor, hebench::TestHarness::DotProduct::Offline::BenchmarkDescriptor, and hebench::TestHarness::DotProduct::Latency::BenchmarkDescriptor.
|
protected |
Creates a DescriptionToken object associated to this IBenchmarkDescription object using the specified benchmark description.
Definition at line 27 of file hebench_ibenchmark.cpp.
|
pure virtual |
Destroys an object returned by createBenchmark()
.
[in] | p_bench | Pointer to object to clean up. |
Implemented in hebench::TestHarness::SimpleSetIntersection::Offline::BenchmarkDescriptor, hebench::TestHarness::SimpleSetIntersection::Latency::BenchmarkDescriptor, hebench::TestHarness::MatrixMultiply::Offline::BenchmarkDescriptor, hebench::TestHarness::MatrixMultiply::Latency::BenchmarkDescriptor, hebench::TestHarness::LogisticRegression::Offline::BenchmarkDescriptor, hebench::TestHarness::LogisticRegression::Latency::BenchmarkDescriptor, hebench::TestHarness::GenericWL::Offline::BenchmarkDescriptor, hebench::TestHarness::GenericWL::Latency::BenchmarkDescriptor, hebench::TestHarness::EltwiseMult::Offline::BenchmarkDescriptor, hebench::TestHarness::EltwiseMult::Latency::BenchmarkDescriptor, hebench::TestHarness::EltwiseAdd::Offline::BenchmarkDescriptor, hebench::TestHarness::EltwiseAdd::Latency::BenchmarkDescriptor, hebench::TestHarness::DotProduct::Offline::BenchmarkDescriptor, and hebench::TestHarness::DotProduct::Latency::BenchmarkDescriptor.
|
pure virtual |
Determines if the represented benchmark can perform the workload described by a specified HEBench benchmark descriptor and configuration.
[in] | engine | Engine requesting the matching. |
[in] | backend_desc | Backend descriptor to match. |
[in] | config | Configuration of benchmark to match. |
IBenchmarkDescription
object is compatible with and can perform the described workload. null
otherwise.The token returned by this method can be passed to createBenchmark() to instantiate the actual benchmark. All fields in the returned token must be fully and correctly set, including the backend BenchmarkDescriptor
with concrete values instead of configurable placeholder values. This token can be used to describe the benchmark.
This method is used by BenchmarkFactory::createBenchmark()
to select the appropriate benchmark to create based on the descriptor and the workload parameters.
Implemented in hebench::TestHarness::PartialBenchmarkDescriptor.