21 lines
573 B
Plaintext
21 lines
573 B
Plaintext
#include <benchmark/benchmark.h>
|
|
#include "cuelim.cuh"
|
|
|
|
using namespace gf256;
|
|
|
|
template <MatGF256 (*GpuFunc)(const MatGF256 &, const MatGF256 &, const GF256 &)>
|
|
void bench_gf256_mul(benchmark::State &state)
|
|
{
|
|
GF256 ff(0b100011101);
|
|
uint_fast32_t seed = 41921095;
|
|
size_t x = state.range(0), y = state.range(1), z = state.range(2);
|
|
MatGF256 A(x, y), B(y, z);
|
|
A.randomize(seed);
|
|
B.randomize(seed);
|
|
for (auto _ : state)
|
|
{
|
|
MatGF256 C(GpuFunc(A, B, ff));
|
|
}
|
|
}
|
|
|
|
BENCHMARK_TEMPLATE(bench_gf256_mul, gpu_mul)->Args({10000, 10000, 10000}); |