HEBench
hebench_simple_set_intersection_o.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_SimpleSetIntersection_O_H_0596d40a3cce4b108a81595c50eb286d
6 #define _HEBench_Harness_SimpleSetIntersection_O_H_0596d40a3cce4b108a81595c50eb286d
7 
8 #include <memory>
9 
10 #include "hebench/modules/general/include/nocopy.h"
11 #include "hebench/modules/logging/include/logging.h"
12 
16 
17 namespace hebench {
18 namespace TestHarness {
19 namespace SimpleSetIntersection {
20 namespace Offline {
21 
23 {
24 public:
25  DISABLE_COPY(BenchmarkDescriptor)
26  DISABLE_MOVE(BenchmarkDescriptor)
27 private:
29 public:
30  // TODO: Ask for ID selection
31  static constexpr std::uint32_t BenchmarkID = 1301;
32  // default number of samples for an operand
33  // (based on docs definition of the workload operation)
34  static constexpr std::uint64_t DefaultBatchSize = 5;
35 
36 public:
37  BenchmarkDescriptor() = default;
38  ~BenchmarkDescriptor() override = default;
39 
40  hebench::TestHarness::PartialBenchmark *createBenchmark(std::shared_ptr<Engine> p_engine,
41  const DescriptionToken &description_token) override;
43 
44 protected:
46  const std::vector<hebench::APIBridge::WorkloadParam> &w_params) const override;
48  const Engine &engine,
49  const BenchmarkDescription::Backend &backend_desc,
50  const BenchmarkDescription::Configuration &config) const override;
51 
52 private:
53  static bool m_b_registered;
54 };
55 
57 {
58 public:
59  DISABLE_COPY(Benchmark)
60  DISABLE_MOVE(Benchmark)
61 private:
62  IL_DECLARE_CLASS_NAME(SimpleSetIntersection::Offline::Benchmark)
63 
64 public:
66 
67  ~Benchmark() override = default;
68 
69 protected:
70  void init() override;
71  IDataLoader::Ptr getDataset() const override { return m_data; }
72  std::uint32_t getEventIDStart() const override { return BenchmarkDescriptor::BenchmarkID; }
73  bool validateResult(IDataLoader::Ptr dataset,
74  const std::uint64_t *param_data_pack_indices,
75  const std::vector<hebench::APIBridge::NativeDataBuffer *> &p_outputs,
76  hebench::APIBridge::DataType data_type) const override;
77 
78 private:
79  DataLoader::Ptr m_data;
80  std::uint64_t m_k_count;
81 
82  Benchmark(std::shared_ptr<Engine> p_engine, const IBenchmarkDescriptor::DescriptionToken &description_token);
83 };
84 
85 } // namespace Offline
86 } // namespace SimpleSetIntersection
87 } // namespace TestHarness
88 } // namespace hebench
89 
90 #endif // defined _HEBench_Harness_SimpleSetIntersection_O_H_0596d40a3cce4b108a81595c50eb286d
Base class for workload benchmarks in the offline category.
Token returned by a successful call to IBenchmarkDescriptor::matchBenchmarkDescriptor().
std::shared_ptr< IDataLoader > Ptr
Bundles values that need to be filled by a workload during completeWorkloadDescription().
void completeWorkloadDescription(WorkloadDescriptionOutput &output, const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config) const override
Completes the description for the matched benchmark.
void destroyBenchmark(hebench::TestHarness::PartialBenchmark *p_bench) override
Destroys an object returned by createBenchmark().
hebench::TestHarness::PartialBenchmark * createBenchmark(std::shared_ptr< Engine > p_engine, const DescriptionToken &description_token) override
Creates the represented IBenchmark object that can perform the workload specified by the HEBench benc...
bool matchBenchmarkDescriptor(const hebench::APIBridge::BenchmarkDescriptor &bench_desc, const std::vector< hebench::APIBridge::WorkloadParam > &w_params) const override
Determines if the represented benchmark can perform the workload described by a specified HEBench ben...
std::uint32_t getEventIDStart() const override
An ID to identify the first event during the benchmark run.
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.
void init() override
Initializes the partial benchmark members.
IDataLoader::Ptr getDataset() const override
Dataset to be used for operations previously initialized during creation of this object.
DataType
Defines data types for a workload.
Definition: types.h:379
@ SimpleSetIntersection
Definition: types.h:268
Defines a benchmark test.
Definition: types.h:527