ComPPare 1.0.0
|
Google Benchmark plugin for the ComPPare framework. More...
#include <google_benchmark.hpp>
Public Member Functions | |
GoogleBenchmarkPlugin (const GoogleBenchmarkPlugin &)=delete | |
GoogleBenchmarkPlugin & | operator= (const GoogleBenchmarkPlugin &)=delete |
template<class Func > | |
benchmark::internal::Benchmark * | register_impl (const std::string &name, Func &&user_fn, const InTup &inputs, OutTup &outs) |
Register an implementation with the Google Benchmark plugin. | |
void | initialize (int &argc, char **argv) override |
Initialize the Google Benchmark plugin. | |
void | run () override |
Run the registered benchmarks. | |
![]() | |
virtual | ~Plugin ()=default |
Static Public Member Functions | |
static std::shared_ptr< Self > | instance () |
Get the singleton instance of the GoogleBenchmarkPlugin. | |
Private Types | |
using | Self = GoogleBenchmarkPlugin< InTup, OutTup > |
Private Member Functions | |
GoogleBenchmarkPlugin ()=default | |
Private Attributes | |
comppare::plugin::google_benchmark::google_benchmark_manager | gb_ |
Google Benchmark plugin for the ComPPare framework.
This plugin integrates the Google Benchmark library into the ComPPare framework. It provides methods to register implementations, initialize the benchmark library, and run the benchmarks. The plugin is designed to work with input and output tuples for flexible benchmarking of various functions.
InTup | The type of the input tuple. |
OutTup | The type of the output tuple. |
|
private |
|
delete |
|
privatedefault |
|
inlineoverridevirtual |
Initialize the Google Benchmark plugin.
This method initializes the Google Benchmark plugin by calling the initialize
method of the internal google_benchmark_manager.
argc | The number of command-line arguments. |
argv | The command-line arguments. |
Reimplemented from comppare::plugin::Plugin< InTup, OutTup >.
|
inlinestatic |
Get the singleton instance of the GoogleBenchmarkPlugin.
This method ensures that only one instance of the GoogleBenchmarkPlugin exists throughout the program. It returns a shared pointer to the instance.
|
delete |
|
inline |
Register an implementation with the Google Benchmark plugin.
Func | The type of the user-provided function. |
name | The name of the implementation. |
user_fn | The function/implementation to register. |
inputs | A const reference to the input tuple. |
outs | A reference to the output tuple. |
This method passes the user-provided function and its arguments to the internal google_benchmark_manager for registration. It uses std::apply
to unpack the input and output tuples and forward them to the manager's add_gbench
method.
|
inlineoverridevirtual |
Run the registered benchmarks.
This method runs the benchmarks by calling the run
method of the internal google_benchmark_manager.
Reimplemented from comppare::plugin::Plugin< InTup, OutTup >.
|
private |