MCPcopy Create free account
hub / github.com/apache/arrow / RandomKernel

Function RandomKernel

cpp/src/arrow/compute/kernels/scalar_random_benchmark.cc:28–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace compute {
27
28static 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
38static void RandomKernelSystem(benchmark::State& state) {
39 RandomKernel(state, /*is_seed=*/false);

Callers 2

RandomKernelSystemFunction · 0.85
RandomKernelSeedFunction · 0.85

Calls 4

FromSeedFunction · 0.85
FromSystemRandomFunction · 0.85
CallFunctionFunction · 0.85
ExecBatchFunction · 0.50

Tested by

no test coverage detected