3 #include <benchmark/benchmark.h>
13 void SetUp(const ::benchmark::State& state) {}
15 void TearDown(const ::benchmark::State& state) {}
22 const t_uint m_imsizex = state.range(0);
23 const t_uint m_imsizey = state.range(0);
24 const t_uint N = m_imsizex * m_imsizey;
25 const auto fftop = purify::operators::init_FFT_2d<Vector<t_complex>>(m_imsizey, m_imsizex, 1.);
26 const auto& forward = std::get<0>(fftop);
28 const Vector<t_complex> input = Vector<t_complex>::Random(N);
29 Vector<t_complex> output = Vector<t_complex>::Zero(N);
30 forward(output, input);
31 while (state.KeepRunning()) {
32 auto start = std::chrono::high_resolution_clock::now();
33 forward(output, input);
34 auto end = std::chrono::high_resolution_clock::now();
42 ->Range(128, 128 << 6)
45 ->ReportAggregatesOnly(
true)
46 ->Unit(benchmark::kMillisecond);
void SetUp(const ::benchmark::State &state)
void TearDown(const ::benchmark::State &state)
BENCHMARK_DEFINE_F(FFTOperatorFixture, Apply)(benchmark
double duration(std::chrono::high_resolution_clock::time_point start, std::chrono::high_resolution_clock::time_point end)