ComPPare 1.0.0
|
Internal container representing one registered implementation. More...
Public Member Functions | |
decltype(auto) | google_benchmark () |
Attach the Google Benchmark plugin. | |
decltype(auto) | nvbench () |
Attach the nvbench plugin. | |
template<template< class, class > class Plugin> requires comppare::plugin::ValidPlugin<Plugin, InTup, OutTup, Func> | |
decltype(auto) | attach () |
Attach a plugin to the output context. | |
Public Attributes | |
std::string | name |
Name of the implementation. | |
Func | fn |
The user-provided function implementing the operation. | |
InTup * | inputs_ptr |
Pointer to the input tuple inputs_ . | |
OutputContext * | parent_ctx |
Reference to the owning OutputContext . This allows the implementation to register plugins. | |
std::unique_ptr< OutTup > | plugin_output = nullptr |
Unique pointer to the output tuple for plugin runs. | |
Internal container representing one registered implementation.
Each Impl
bundles together:
fn
) under a given name,OutputContext
,This allows the framework to keep track of multiple competing implementations of the same operation (e.g. reference vs optimized), and to attach correctness/performance plugins such as Google Benchmark or NVBench.
|
inline |
Attach a plugin to the output context.
Plugin | The plugin type to attach. |
register_impl
method.auto
, the return type would remove its reference-ness and const-ness; while decltype(auto) preserves it. Reference: Effective Modern C++ Item 3: Understand decltype
|
inline |
Attach the Google Benchmark plugin.
This function adds the Google Benchmark plugin for the current implementation.
|
inline |
Attach the nvbench plugin.
This function adds the nvbench plugin for the current implementation.
Func comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::fn |
The user-provided function implementing the operation.
This function must match the signature defined by Func
, taking all input arguments by const reference, and all output arguments by non-const reference.
InTup* comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::inputs_ptr |
Pointer to the input tuple inputs_
.
std::string comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::name |
Name of the implementation.
This is used to identify the implementation in logs and reports.
OutputContext* comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::parent_ctx |
Reference to the owning OutputContext
. This allows the implementation to register plugins.
std::unique_ptr<OutTup> comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::plugin_output = nullptr |
Unique pointer to the output tuple for plugin runs.
This allows the implementation to provide a separate output instance for plugins, avoiding interference with the main output.