| 693 | |
| 694 | template <typename ArrowType> |
| 695 | static void MinMaxKernelBench(benchmark::State& state) { |
| 696 | using CType = typename TypeTraits<ArrowType>::CType; |
| 697 | |
| 698 | RegressionArgs args(state); |
| 699 | const int64_t array_size = args.size / sizeof(CType); |
| 700 | auto rand = random::RandomArrayGenerator(1923); |
| 701 | auto array = rand.Numeric<ArrowType>(array_size, -100, 100, args.null_proportion); |
| 702 | |
| 703 | for (auto _ : state) { |
| 704 | ABORT_NOT_OK(MinMax(array).status()); |
| 705 | } |
| 706 | |
| 707 | state.SetItemsProcessed(state.iterations() * array_size); |
| 708 | } |
| 709 | |
| 710 | static void MinMaxKernelBenchArgs(benchmark::internal::Benchmark* bench) { |
| 711 | BenchmarkSetArgsWithSizes(bench, {1 * 1024 * 1024}); // 1M |