37 const int width = dims.
x;
38 const int height = dims.
y;
40 int dstPitch = dims.
x;
41 int srcPitch = dims.
x;
48 std::vector<uint8_t> dst(
static_cast<size_t>(dstPitch) * height, uint8_t(0));
49 std::vector<uint8_t> src(
static_cast<size_t>(srcPitch) * height, uint8_t(0));
51 for (
auto _ : state) {
52 copyPixels(
reinterpret_cast<std::byte*
>(&(dst[0])), dstPitch,
53 reinterpret_cast<const std::byte*
>(&(src[0])), srcPitch, width,
57 state.SetComplexityN(dims.
area());
58 state.counters.insert(
60 benchmark::Counter(
sizeof(uint8_t) * dims.
area(),
61 benchmark::Counter::Flags::kIsIterationInvariantRate,
62 benchmark::Counter::kIs1024)}});
74 b->MeasureProcessCPUTime();
76 b->Unit(benchmark::kMicrosecond);
78 static constexpr int L2dByteSize = 512U * (1U << 10U);
79 static constexpr int L2dNPixels = L2dByteSize / 2;
80 static constexpr int MaxPixelsOptimal = (1 << 5) * L2dNPixels;
87 b->RangeMultiplier(2);
88 if constexpr ((
false)) {
89 b->Arg(MaxPixelsOptimal);
91 b->Range(1, 2 * MaxPixelsOptimal)->Complexity(benchmark::oN);