Skip to content

Commit

Permalink
TESTS: testfftperf: there is no gsl fft anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld committed Nov 25, 2023
1 parent 7b13f2d commit 059a38f
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions tests/testfftperf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ time_fftsc()
static double
measure (const string& name, void (*func)(), bool is_complex)
{
double clocks_per_sec = 2500.0 * 1000 * 1000;
unsigned int runs = 10000;
double ns_per_sec = 1e9;
unsigned int runs = 100000;

// warmup run:
func();
Expand All @@ -51,24 +51,11 @@ measure (const string& name, void (*func)(), bool is_complex)
for (unsigned int i = 0; i < runs; i++)
func();
double end = get_time();
printf ("%s: %f clocks/sample\n", name.c_str(), clocks_per_sec * (end - start) / (is_complex ? (block_size / 2) : block_size) / runs);
printf ("%s: %f clocks/sample\n", name.c_str(), ns_per_sec * (end - start) / (is_complex ? (block_size / 2) : block_size) / runs);

return (end - start);
}

static void
compare (const string& name, void (*func)(), bool is_complex)
{
FFT::use_gsl_fft (false);
double fftw = measure (name + "(fftw)", func, is_complex);

FFT::use_gsl_fft (true);
double gsl = measure (name + "(gsl)", func, is_complex);

printf (" => speedup: %.3f\n", gsl / fftw);
printf ("\n");
}

int
main (int argc, char **argv)
{
Expand All @@ -85,11 +72,11 @@ main (int argc, char **argv)

printf ("========================= BLOCK_SIZE = %d =========================\n", block_size);

compare ("fftar", time_fftar, false);
compare ("fftsr", time_fftsr, false);
measure ("fftar", time_fftar, false);
measure ("fftsr", time_fftsr, false);

compare ("fftac", time_fftac, true);
compare ("fftsc", time_fftsc, true);
measure ("fftac", time_fftac, true);
measure ("fftsc", time_fftsc, true);

FFT::free_array_float (in);
FFT::free_array_float (out);
Expand Down

0 comments on commit 059a38f

Please sign in to comment.