| 33 | |
| 34 | template <BooleanBinaryOp& Op> |
| 35 | static void ArrayArrayKernel(benchmark::State& state) { |
| 36 | RegressionArgs args(state); |
| 37 | |
| 38 | const int64_t array_size = args.size * 8; |
| 39 | |
| 40 | auto rand = random::RandomArrayGenerator(kSeed); |
| 41 | auto lhs = rand.Boolean(array_size, /*true_probability=*/0.5, args.null_proportion); |
| 42 | auto rhs = rand.Boolean(array_size, /*true_probability=*/0.5, args.null_proportion); |
| 43 | |
| 44 | for (auto _ : state) { |
| 45 | ABORT_NOT_OK(Op(lhs, rhs, nullptr)); |
| 46 | } |
| 47 | state.SetItemsProcessed(state.iterations() * array_size); |
| 48 | } |
| 49 | |
| 50 | void SetArgs(benchmark::internal::Benchmark* bench) { |
| 51 | BenchmarkSetArgsWithSizes(bench, {kL1Size, kL2Size}); |