1#include <benchmark/benchmark.h>
8using namespace benchmark;
13void BM_pure_to_radix(State& state)
17 for (
auto _ : state) {
20 uint32_t num_limbs =
static_cast<uint32_t
>(state.range(0));
21 uint32_t radix =
static_cast<uint32_t
>(state.range(1));
23 benchmark::DoNotOptimize(pure_to_radix.
to_le_radix(
value, num_limbs, radix));
27void BM_pure_to_bits(State& state)
31 for (
auto _ : state) {
34 uint32_t num_limbs =
static_cast<uint32_t
>(state.range(0));
40void BM_pure_to_radix_memory(State& state)
44 for (
auto _ : state) {
47 uint32_t num_limbs =
static_cast<uint32_t
>(state.range(0));
48 uint32_t radix =
static_cast<uint32_t
>(state.range(1));
51 for (uint32_t i = 0; i < num_limbs; i++) {
52 value =
value * radix +
static_cast<uint32_t
>(rand()) % radix;
59BENCHMARK(BM_pure_to_radix)->Ranges({ { 2, 256 }, { 2, 256 } })->
Unit(benchmark::kMillisecond);
60BENCHMARK(BM_pure_to_bits)->Ranges({ { 2, 256 } })->
Unit(benchmark::kMillisecond);
61BENCHMARK(BM_pure_to_radix_memory)->Ranges({ { 2, 256 }, { 2, 256 } })->
Unit(benchmark::kMillisecond);
void to_be_radix(MemoryInterface &memory, const FF &value, uint32_t radix, uint32_t num_limbs, bool is_output_bits, MemoryAddress dst_addr) override
std::pair< std::vector< bool >, bool > to_le_bits(const FF &value, uint32_t num_limbs) override
std::pair< std::vector< uint8_t >, bool > to_le_radix(const FF &value, uint32_t num_limbs, uint32_t radix) override
Unit(benchmark::kMillisecond) -> RangeMultiplier(2) ->Range(2, MAX_BATCH_SIZE) ->Iterations(1000)
BENCHMARK(extend_2_to_11)
static field random_element(numeric::RNG *engine=nullptr) noexcept