cuElim/benchmark/bench_mul8.cu

19 lines
542 B
Plaintext
Raw Normal View History

2024-09-05 23:46:07 +08:00
#include <benchmark/benchmark.h>
#include "cuelim.cuh"
2024-09-06 15:58:40 +08:00
template <MatGF256 (*GpuFunc)(const MatGF256 &, const MatGF256 &, const GF256 &)>
2024-09-05 23:46:07 +08:00
void bench_mul8(benchmark::State &state)
{
2024-09-06 15:58:40 +08:00
GF256 ff(0b100011101);
2024-09-05 23:46:07 +08:00
uint_fast32_t seed = 41921095;
size_t x = state.range(0), y = state.range(1), z = state.range(2);
2024-09-06 15:58:40 +08:00
MatGF256 A(x, y), B(y, z);
2024-09-05 23:46:07 +08:00
A.randomize(seed);
B.randomize(seed);
for (auto _ : state)
{
2024-09-06 15:58:40 +08:00
MatGF256 C(GpuFunc(A, B, ff));
2024-09-05 23:46:07 +08:00
}
}
BENCHMARK_TEMPLATE(bench_mul8, gpu_mul)->Args({100000, 100000, 100000});