HEBench
hebench_benchmark_factory.h
Go to the documentation of this file.
1 
2 // Copyright (C) 2021 Intel Corporation
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef _HEBench_Harness_Benchmark_Factory_H_0596d40a3cce4b108a81595c50eb286d
6 #define _HEBench_Harness_Benchmark_Factory_H_0596d40a3cce4b108a81595c50eb286d
7 
8 #include <memory>
9 #include <string>
10 #include <vector>
11 
12 #include "hebench/modules/general/include/nocopy.h"
13 #include "hebench/modules/logging/include/logging.h"
14 
16 #include "hebench_ibenchmark.h"
18 
19 namespace hebench {
20 namespace TestHarness {
21 
22 class Engine;
23 
24 class BenchmarkFactory final
25 {
26 public:
27  DISABLE_COPY(BenchmarkFactory)
28  DISABLE_MOVE(BenchmarkFactory)
29 private:
30  IL_DECLARE_CLASS_NAME(BenchmarkFactory)
31 public:
32  friend class Engine;
33 
44  const BenchmarkDescription::Backend &backend_desc,
58  static bool registerSupportedBenchmark(std::shared_ptr<IBenchmarkDescriptor> p_desc_obj);
59 
60 private:
61  static std::vector<std::shared_ptr<IBenchmarkDescriptor>> &getRegisteredBenchmarks();
75  static IBenchmark::Ptr createBenchmark(std::shared_ptr<Engine> p_engine,
78 
79  BenchmarkFactory() = default;
80 };
81 
82 } // namespace TestHarness
83 } // namespace hebench
84 
85 #endif // defined _HEBench_Harness_Benchmark_Factory_H_0596d40a3cce4b108a81595c50eb286d
static IBenchmarkDescriptor::DescriptionToken::Ptr matchBenchmarkDescriptor(const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config)
Returns a token representing a benchmark that can perform the described workload with specified param...
static bool registerSupportedBenchmark(std::shared_ptr< IBenchmarkDescriptor > p_desc_obj)
Registers a benchmark description object that represents one of the supported workloads.
std::shared_ptr< IBenchmark > Ptr
ErrorCode createBenchmark(Handle h_engine, Handle h_bench_desc, const WorkloadParams *p_params, Handle *h_benchmark)
Instantiates a benchmark on the backend.