Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
microbenchmark-adaptor.hpp File Reference

Helpers and wrappers so simplify usage of microbenchmark.hpp. More...

Go to the source code of this file.

Description

Helpers and wrappers so simplify usage of microbenchmark.hpp.

Notably the benchmark functions expect the actual »test subject« as a function or lambda with signature size_t(size_t). The argument will be the loop index and the result value will be added into a checksum, which also ensures that the optimiser can not unroll the benchmark loop. However, in practical use this strict requirement for the signature turned out as a nuisance; this header provides some automatic adaption

  • accept any numeric type as argument
  • accept any numeric type as checksum contribution (cast to size_t)
  • accept signature void(void)

Definition in file microbenchmark-adaptor.hpp.

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::test
 Unit tests for the Lumiera support library.
 
namespace  lib::test::microbenchmark
 

Classes

struct  Adaptor< SIG, SEL >
 
struct  Adaptor< size_t(size_t)>
 
struct  Adaptor< void(void)>
 
struct  Adaptor< ON(IN), enable_if< __and_< is_arithmetic< IN >, __not_< is_same< IN, size_t > >, is_arithmetic< ON >, __not_< is_same< ON, size_t > > > > >
 
struct  Adaptor< ON(void), enable_if< __and_< is_arithmetic< ON >, __not_< is_same< ON, size_t > > > > >
 
struct  Adaptor< void(IN), enable_if< __and_< is_arithmetic< IN >, __not_< is_same< IN, size_t > > > > >
 

Functions

template<typename FUN >
decltype(auto) adapted4benchmark (FUN &&fun)
 Adapter to expose the signature size_t(size_t) from any suitable source functor or lambda.
 

Class Documentation

◆ lib::test::microbenchmark::Adaptor

struct lib::test::microbenchmark::Adaptor
+ Collaboration diagram for Adaptor< SIG, SEL >: