HEBench
hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory Class Reference

#include <hebench_genericwl.h>

Inheritance diagram for hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory:
Collaboration diagram for hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory:

Public Member Functions

 BenchmarkDescriptorCategory ()=default
 
 ~BenchmarkDescriptorCategory () override=default
 
- Public Member Functions inherited from hebench::TestHarness::PartialBenchmarkDescriptor
 PartialBenchmarkDescriptor ()
 
 ~PartialBenchmarkDescriptor () override
 
DescriptionToken::Ptr matchDescriptor (const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config) const override final
 Implementation of IBenchmarkDescriptor::matchDescriptor(). More...
 
- Public Member Functions inherited from hebench::TestHarness::IBenchmarkDescriptor
 IBenchmarkDescriptor ()=default
 
virtual ~IBenchmarkDescriptor ()=default
 
virtual PartialBenchmarkcreateBenchmark (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...
 

Static Public Member Functions

static std::pair< std::vector< std::uint64_t >, std::vector< std::uint64_t > > fetchIOVectorSizes (const std::vector< hebench::APIBridge::WorkloadParam > &w_params)
 Retrieves details about the input parameters and results of the generic operation based on the specified flexible workload parameters. More...
 
- Static Public Member Functions inherited from hebench::TestHarness::PartialBenchmarkDescriptor
static bool getForceConfigValues ()
 Specifies whether frontend will override backend descriptors using configuration data or not. More...
 
static void setForceConfigValues (bool value)
 Sets whether frontend will override backend descriptors using configuration data or not. More...
 
static std::uint64_t computeSampleSizes (std::uint64_t *sample_sizes, std::size_t param_count, const std::vector< std::uint64_t > &config_sample_sizes, const hebench::APIBridge::BenchmarkDescriptor &bench_desc, std::uint64_t default_sample_size_fallback, bool force_config)
 Extracts the batch sizes for a workload from a specified HEBench API benchmark descriptor. More...
 

Static Public Attributes

static constexpr const char * BaseWorkloadName = "Generic"
 
static constexpr std::uint64_t WorkloadParameterMinCount = 4
 
static constexpr hebench::APIBridge::WorkloadParamType::WorkloadParamType WorkloadParameterType
 

Protected Member Functions

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 benchmark descriptor and workload parameters. More...
 
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. More...
 
- Protected Member Functions inherited from hebench::TestHarness::IBenchmarkDescriptor
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...
 

Additional Inherited Members

- Static Protected Member Functions inherited from hebench::TestHarness::PartialBenchmarkDescriptor
static std::unordered_set< std::size_t > getCipherParamPositions (std::uint32_t cipher_param_mask)
 
static std::string getCategoryName (hebench::APIBridge::Category category)
 
static std::string getDataTypeName (hebench::APIBridge::DataType data_type)
 
static void completeCategoryParams (hebench::APIBridge::BenchmarkDescriptor &out_descriptor, const hebench::APIBridge::BenchmarkDescriptor &in_descriptor, const BenchmarkDescription::Configuration &config, bool force_config)
 Completes common elements of category parameters in a descriptor using the specified configuration. More...
 

Detailed Description

Definition at line 26 of file hebench_genericwl.h.

Constructor & Destructor Documentation

◆ BenchmarkDescriptorCategory()

hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::BenchmarkDescriptorCategory ( )
default

◆ ~BenchmarkDescriptorCategory()

hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::~BenchmarkDescriptorCategory ( )
overridedefault

Member Function Documentation

◆ completeWorkloadDescription()

void hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::completeWorkloadDescription ( WorkloadDescriptionOutput output,
const Engine engine,
const BenchmarkDescription::Backend backend_desc,
const BenchmarkDescription::Configuration config 
) const
overrideprotectedvirtual

Completes the description for the matched benchmark.

Parameters
[out]outputStructure to receive the completed description.
[in]engineEngine that requested the matching.
[in]backend_descBackend descriptor to be described.
[in]configConfiguration for the benchmark being described.
Exceptions
std::invalid_argumentif fields in backend_desc or config are not supported or invalid.

This method will only be called if PartialBenchmarkDescriptor::matchBenchmarkDescriptor(const hebench::APIBridge::BenchmarkDescriptor &, const std::vector<hebench::APIBridge::WorkloadParam> &) returns true.

All fields in config are valid. In backend_desc: field operation_params_count is expected to be returned by this method; field descriptor is the original returned from the backend, and it is expected that this method returns the final, concrete version. All other input parameters are valid. Use these values to complete all fields in output.

This method must fill out all fields in the output structure. Field workload_header may be set to empty string, but workload_name and operation_params_count must be set to the correct values. Field concrete_descriptor must be set to the completed benchmark descriptor, where all configurable values are replaced by the concrete, final values. See WorkloadDescriptionOutput for more details.

If extra header information returned in workload_header is not empty, it will be appended in the report to a pre-generated header in CSV format. The following is an example of a pre-generated header:

Specifications,
, Encryption,
, , Scheme, CKKS
, , Security, 128 bits
, , Poly mod degree, 8192
, , Primes, 3
, , Warmup iterations, 2
, , Minimum test time (ms), 2000
, Workload, Element-wise Vector Addition (1000)
, , Data type, Float64
, , Encrypted parameters, All
@ Float64
64 bits IEEE 754 standard floating point real numbers.
Definition: types.h:306
Category
Defines all possible categories for each workload.
Definition: types.h:391
std::int32_t Scheme
Open-ended homomorphic encryption scheme ID.
Definition: types.h:406
std::int32_t Security
Open-ended homomorphic encryption scheme security ID.
Definition: types.h:412
Workload
Defines all possible workloads.
Definition: types.h:83

output .workload_header will be appended at the next line immediately after this.

See also
WorkloadDescriptionOutput

Implements hebench::TestHarness::PartialBenchmarkDescriptor.

Reimplemented in hebench::TestHarness::GenericWL::Offline::BenchmarkDescriptor, and hebench::TestHarness::GenericWL::Latency::BenchmarkDescriptor.

Definition at line 103 of file hebench_genericwl.cpp.

◆ fetchIOVectorSizes()

std::pair< std::vector< std::uint64_t >, std::vector< std::uint64_t > > hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::fetchIOVectorSizes ( const std::vector< hebench::APIBridge::WorkloadParam > &  w_params)
static

Retrieves details about the input parameters and results of the generic operation based on the specified flexible workload parameters.

Parameters
[in]w_paramsFlexible workload parameters describing the operation.
Returns
A pair where the first element represents the vector sizes for each component of the operation input; the second element represents the vector sizes for each component of the operation output.

Definition at line 19 of file hebench_genericwl.cpp.

◆ matchBenchmarkDescriptor()

bool hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::matchBenchmarkDescriptor ( const hebench::APIBridge::BenchmarkDescriptor bench_desc,
const std::vector< hebench::APIBridge::WorkloadParam > &  w_params 
) const
overrideprotectedvirtual

Determines if the represented benchmark can perform the workload described by a specified HEBench benchmark descriptor and workload parameters.

Parameters
[in]bench_descDescriptor to which compare.
[in]w_paramsArguments for the workload parameters.
Returns
true if the represented benchmark can perform the specified described workload.
false if no match was found.

This method is used by BenchmarkFactory::createBenchmark() to select the appropriate benchmark to create based on the descriptor.

See also
IBenchmarkDescriptor::matchDescriptor()

Implements hebench::TestHarness::PartialBenchmarkDescriptor.

Reimplemented in hebench::TestHarness::GenericWL::Offline::BenchmarkDescriptor, and hebench::TestHarness::GenericWL::Latency::BenchmarkDescriptor.

Definition at line 80 of file hebench_genericwl.cpp.

Member Data Documentation

◆ BaseWorkloadName

constexpr const char* hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::BaseWorkloadName = "Generic"
staticconstexpr

Definition at line 34 of file hebench_genericwl.h.

◆ WorkloadParameterMinCount

constexpr std::uint64_t hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::WorkloadParameterMinCount = 4
staticconstexpr

Definition at line 35 of file hebench_genericwl.h.

◆ WorkloadParameterType

constexpr hebench::APIBridge::WorkloadParamType::WorkloadParamType hebench::TestHarness::GenericWL::BenchmarkDescriptorCategory::WorkloadParameterType
staticconstexpr
Initial value:

Definition at line 36 of file hebench_genericwl.h.


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