| 26 | namespace compute { |
| 27 | |
| 28 | static void RandomKernel(benchmark::State& state, bool is_seed) { |
| 29 | const int64_t length = state.range(0); |
| 30 | const auto options = |
| 31 | is_seed ? RandomOptions::FromSeed(42) : RandomOptions::FromSystemRandom(); |
| 32 | for (auto _ : state) { |
| 33 | ABORT_NOT_OK(CallFunction("random", ExecBatch({}, length), &options)); |
| 34 | } |
| 35 | state.SetItemsProcessed(state.iterations() * length); |
| 36 | } |
| 37 | |
| 38 | static void RandomKernelSystem(benchmark::State& state) { |
| 39 | RandomKernel(state, /*is_seed=*/false); |
no test coverage detected