83 CHECK (isnil (myCounter));
84 CHECK (0==myCounter.size());
86 CHECK (0 == myCounter.get<
short>());
87 CHECK (0 < myCounter.size());
95 CHECK (0 == myCounter.get<
X>());
96 size_t sX = myCounter.size();
98 CHECK (0 == myCounter.get<U>());
99 CHECK (sX + 1 == myCounter.size());
100 CHECK (0 == myCounter.get<
X>());
101 CHECK (sX + 1 == myCounter.size());
103 CHECK (-1 == myCounter.dec<
X>());
104 CHECK (-2 == myCounter.dec<
X>());
105 CHECK (+1 == myCounter.inc<U>());
107 CHECK (-2 == myCounter.get<
X>());
108 CHECK (+1 == myCounter.get<U>());
115 CHECK (0 < typeID_short);
116 CHECK (0 < typeID_X);
117 CHECK (0 < typeID_U);
118 CHECK (typeID_short < typeID_X);
119 CHECK (typeID_X < typeID_U);
122 CHECK (sX + 1 == myCounter.size());
148 return std::array<Operator, MAX_INDEX>{increment<I>...};
153 sumAllCounters(
TypedCounter& counter, std::index_sequence<I...>)
155 return (counter.get<
Dummy<I>>() + ... );
173 using IDX = std::make_index_sequence<MAX_INDEX>;
178 auto testSubject = [&
179 ,gen = makeRandGen()]
180 (size_t)
mutable ->
size_t 183 operators[i](testCounter);
190 CHECK (sumAllCounters(testCounter, IDX{}) == expectedIncrements);
Creating series of type-based contexts.
Utility providing a set of counters, each tied to a specific type.
const uint NUM_ITERATIONS
number of repeated random accesses per Thread
const uint NUM_THREADS
number of threads to run in parallel
int rani(uint bound=_iBOUND())
Functions to perform (multithreaded) timing measurement on a given functor.
Implementation namespace for support and library code.
const uint MAX_INDEX
number of distinct types / counters
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Generating (pseudo) random numbers with controlled seed.
Provide type-IDs for a specific context.
static auto buildOperatorsTable(std::index_sequence< I... >)
Helper for tortureTest(): Build a table of functors, where the i-th entry invokes the function increm...
parametrised marker type to designate a counter to be incremented