Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pocketfft_cxx and duccfft benchees #5

Merged
merged 5 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchees/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SUBDIRS = acml arprec bloodworth burrus cross cwplib dfftpack dsp dxml \
SUBDIRS = acml arprec bloodworth burrus cross cwplib dfftpack dsp duccfft dxml \
emayer esrfft essl ffmpeg ffte fftj fftpack fftreal fftw2 fftw3 fxt \
glassman goedecker gpfa green-ffts-2.0 gsl harm hp-mlib imsl intel-mkl \
intel-ipps jmfft kissfft krukar mfft minfft mixfft monnier morris \
mpfun77 mpfun90 nag napack newsplit nr numutils ooura pocketfft qft \
mpfun77 mpfun90 nag napack newsplit nr numutils ooura pocketfft pocketfft_cxx qft \
ransom rmayer scimark2c sciport sgimath singleton sorensen spiral-fft \
statlib sunperf temperton teneyck valkenburg vbigdsp vdsp

Expand Down
8 changes: 8 additions & 0 deletions benchees/duccfft/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PRG=doit

AM_CPPFLAGS = $(INCLBENCH)

doit_SOURCES=doit.cc
doit_LDADD=$(LIBBENCH) @FLIBS@

include ../Makefile.common
84 changes: 84 additions & 0 deletions benchees/duccfft/doit.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* this program is in the public domain */

#include <iostream>
#include "bench-user.h"
#include "ducc0/infra/threading.cc"
#include "ducc0/fft/fft.h"
#include <cmath>
#include <cstring>

using namespace std;
using namespace ducc0;

BEGIN_BENCH_DOC
BENCH_DOC("name", "duccfft")
BENCH_DOC("author", "Martin Reinecke")
BENCH_DOC("year", "2021")
BENCH_DOC("version", "1.0")
BENCH_DOC("language", "C++")
BENCH_DOC("url", "https://gitlab.mpcdf.mpg.de/mtr/ducc")
BENCH_DOC("url-was-valid-on", "Fri Jul 23 23:06:24 ACST 2020")
BENCH_DOC("copyright", "GPLv2+")
END_BENCH_DOC

int can_do(struct problem * /*p*/)
{
return true;
}

void copy_h2c(struct problem *p, bench_complex *out)
{
copy_h2c_1d_fftpack(p, out, -1.0);
}

void copy_c2h(struct problem *p, bench_complex *in)
{
copy_c2h_1d_fftpack(p, in, -1.0);
}

static fmav_info::shape_t axes;
static cfmav<complex<bench_real>> in_c;
static vfmav<complex<bench_real>> out_c;
static cfmav<bench_real> in_r;
static vfmav<bench_real> out_r;

void setup(struct problem *p)
{
BENCH_ASSERT(can_do(p));

fmav_info::shape_t shape(p->rank);
axes.resize(p->rank);
for (int i=0; i<p->rank; ++i) {
shape[i] = p->n[i];
axes[i] = i;
}
mreineck marked this conversation as resolved.
Show resolved Hide resolved

if (p->kind == PROBLEM_COMPLEX) {
auto in = reinterpret_cast<complex<bench_real> *>(p->in);
auto out = reinterpret_cast<complex<bench_real> *>(p->out);
in_c.assign(cfmav<complex<bench_real>>(in, shape));
out_c.assign(vfmav<complex<bench_real>>(out, shape));
} else {
auto in = reinterpret_cast<bench_real *>(p->in);
auto out = reinterpret_cast<bench_real *>(p->out);
in_r.assign(cfmav<bench_real>(in, shape));
out_r.assign(vfmav<bench_real>(out, shape));
}
}

void doit(int iter, struct problem *p)
{
if (p->kind == PROBLEM_COMPLEX) {
for (int i = 0; i < iter; ++i) {
c2c(in_c,out_c,axes,p->sign==-1,bench_real(1));
}
} else {
for (int i = 0; i < iter; ++i) {
r2r_fftpack(in_r,out_r,axes,p->sign==-1,p->sign==-1,bench_real(1));
}
}
}

void done(struct problem *p)
{
}
Loading