MCPcopy Create free account
hub / github.com/ashvardanian/less_slow.cpp / pipeline_cpp11_std_function

Function pipeline_cpp11_std_function

less_slow.cpp:3693–3706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3691}
3692
3693static void pipeline_cpp11_std_function(bm::State &state) {
3694 std::uint64_t sum = 0, count = 0;
3695 for (auto _ : state) {
3696 sum = 0, count = 0;
3697 for_range_stl(pipe_start, pipe_end, [&](std::uint64_t value) {
3698 filter_stl(value, is_power_of_two, [&](std::uint64_t value) {
3699 filter_stl(value, is_power_of_three, [&](std::uint64_t value) {
3700 prime_factors_stl(value, [&](std::uint64_t factor) { sum += factor, count++; });
3701 });
3702 });
3703 });
3704 if (count != 84 || sum != 645) state.SkipWithError("Incorrect result");
3705 }
3706}
3707
3708BENCHMARK(pipeline_cpp11_std_function);
3709

Callers

nothing calls this directly

Calls 3

for_range_stlFunction · 0.85
filter_stlFunction · 0.85
prime_factors_stlFunction · 0.85

Tested by

no test coverage detected