[#16]:svarga:refactor, std::tuple type-axis (throughput<Tuple>) and retire bench::types<>#17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16.
The type axis is now a plain
std::tuplepassed as an explicit template argument; thebench::types<Ts...>marker is retired (redundant —static_foralready iterates astd::tuple).Engine
template<class Tuple, class... args_t> requires impl::is_tuple<Tuple> void throughput(args_t...)— calledbench::throughput<std::tuple<A,B,C>>(...). Same fold/timing/stats/rows as before (one row per (type,x),"<name>/<typelabel>").Tupleis the leading explicit template arg, constrained by a newimpl::is_tupleconcept (is_specialization_of+remove_cvref). It's never deduced, so a plainthroughput(name{...}, ...)falls through to the scalar overload;throughput<std::tuple<...>>(...)selects this one. Both verified.struct typesand the old marker overload.Migrated call sites (
grep -rn 'bench::types'→ empty)test/type_dispatch.cpp,examples/type_dispatch.cpp,examples/heatmap.cpp,README.md, andexamples/memcpy_bandwidth.cpp(rewritten to the designed typed-tuple form:std::tuple<uint8_t,uint16_t,uint32_t,uint64_t>with typed static buffers and a[&]<class T>body).Verification
Build green (
-DBENCH_BUILD_EXAMPLES=ON); ctest 5/5;memcpy_bandwidth/type_dispatch/heatmapexamples all run.Base:
staging.