ComPPare 1.0.0
Loading...
Searching...
No Matches
comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl Struct Reference

Internal container representing one registered implementation. More...

Collaboration diagram for comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl:
[legend]

Public Member Functions

decltype(autogoogle_benchmark ()
 Attach the Google Benchmark plugin.
 
decltype(autonvbench ()
 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.
 
InTupinputs_ptr
 Pointer to the input tuple inputs_.
 
OutputContextparent_ctx
 Reference to the owning OutputContext. This allows the implementation to register plugins.
 
std::unique_ptr< OutTupplugin_output = nullptr
 Unique pointer to the output tuple for plugin runs.
 

Detailed Description

template<typename... Inputs>
template<OutSpec... OutputSpecs>
struct comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl

Internal container representing one registered implementation.

Each Impl bundles together:

  • the user function (fn) under a given name,
  • a pointer to the input tuple,
  • a back-reference to the owning OutputContext,
  • and optionally, plugin-managed output storage.

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.

Member Function Documentation

◆ attach()

template<typename... Inputs>
template<OutSpec... OutputSpecs>
template<template< class, class > class Plugin>
requires comppare::plugin::ValidPlugin<Plugin, InTup, OutTup, Func>
decltype(auto) comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::attach ( )
inline

Attach a plugin to the output context.

Template Parameters
PluginThe plugin type to attach.
Returns
The return of the plugin's register_impl method.
Note
decltype(auto) is used to preserve the return type of the plugin's register_impl method. When using 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

◆ google_benchmark()

template<typename... Inputs>
template<OutSpec... OutputSpecs>
decltype(auto) comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::google_benchmark ( )
inline

Attach the Google Benchmark plugin.

This function adds the Google Benchmark plugin for the current implementation.

◆ nvbench()

template<typename... Inputs>
template<OutSpec... OutputSpecs>
decltype(auto) comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::nvbench ( )
inline

Attach the nvbench plugin.

This function adds the nvbench plugin for the current implementation.

Member Data Documentation

◆ fn

template<typename... Inputs>
template<OutSpec... OutputSpecs>
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.

◆ inputs_ptr

template<typename... Inputs>
template<OutSpec... OutputSpecs>
InTup* comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::inputs_ptr

Pointer to the input tuple inputs_.

◆ name

template<typename... Inputs>
template<OutSpec... OutputSpecs>
std::string comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::name

Name of the implementation.

This is used to identify the implementation in logs and reports.

◆ parent_ctx

template<typename... Inputs>
template<OutSpec... OutputSpecs>
OutputContext* comppare::InputContext< Inputs >::OutputContext< OutputSpecs >::Impl::parent_ctx

Reference to the owning OutputContext. This allows the implementation to register plugins.

◆ plugin_output

template<typename... Inputs>
template<OutSpec... OutputSpecs>
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.


The documentation for this struct was generated from the following file: