83 constexpr int bytesPerItem =
sizeof(T);
86 benchmark::DoNotOptimize(numBytes);
88 const std::vector<std::byte> inStorage(
94 std::array<std::byte, bytesPerItem> outStorage;
98 for (
auto _ : state) {
99 for (
int inPos = 0; inPos < numBytes; inPos += bytesPerItem) {
100 Impl(out, in, inPos);
101 benchmark::DoNotOptimize(out.begin());
105 state.SetComplexityN(numBytes);
106 state.counters.insert({
108 benchmark::Counter(
sizeof(std::byte) * state.complexity_length_n(),
109 benchmark::Counter::Flags::kIsIterationInvariantRate,
110 benchmark::Counter::kIs1024)},
112 benchmark::Counter(
sizeof(std::byte) * state.complexity_length_n(),
113 benchmark::Counter::Flags::kIsIterationInvariantRate |
114 benchmark::Counter::Flags::kInvert,
115 benchmark::Counter::kIs1000)},
120 b->Unit(benchmark::kMicrosecond);
122 static constexpr int L1dByteSize = 32U * (1U << 10U);
123 static constexpr int L2dByteSize = 512U * (1U << 10U);
124 static constexpr int MaxBytesOptimal = L2dByteSize;
131 b->RangeMultiplier(2);
132 if constexpr ((
true))
133 b->Arg(MaxBytesOptimal);
135 b->Range(1, 2048UL << 20)->Complexity(benchmark::oN);