annotate src/fftw-3.3.8/libbench2/verify.h @ 167:bd3cc4d1df30

Add FFTW 3.3.8 source, and a Linux build
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Nov 2019 14:52:55 +0000
parents
children
rev   line source
cannam@167 1 /*
cannam@167 2 * Copyright (c) 2003, 2007-14 Matteo Frigo
cannam@167 3 * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
cannam@167 4 *
cannam@167 5 * This program is free software; you can redistribute it and/or modify
cannam@167 6 * it under the terms of the GNU General Public License as published by
cannam@167 7 * the Free Software Foundation; either version 2 of the License, or
cannam@167 8 * (at your option) any later version.
cannam@167 9 *
cannam@167 10 * This program is distributed in the hope that it will be useful,
cannam@167 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@167 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@167 13 * GNU General Public License for more details.
cannam@167 14 *
cannam@167 15 * You should have received a copy of the GNU General Public License
cannam@167 16 * along with this program; if not, write to the Free Software
cannam@167 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
cannam@167 18 *
cannam@167 19 */
cannam@167 20
cannam@167 21 #include "libbench2/bench.h"
cannam@167 22
cannam@167 23 typedef bench_real R;
cannam@167 24 typedef bench_complex C;
cannam@167 25
cannam@167 26 typedef struct dofft_closure_s {
cannam@167 27 void (*apply)(struct dofft_closure_s *k,
cannam@167 28 bench_complex *in, bench_complex *out);
cannam@167 29 int recopy_input;
cannam@167 30 } dofft_closure;
cannam@167 31
cannam@167 32 double dmax(double x, double y);
cannam@167 33
cannam@167 34 typedef void (*aconstrain)(C *a, int n);
cannam@167 35
cannam@167 36 void arand(C *a, int n);
cannam@167 37 void mkreal(C *A, int n);
cannam@167 38 void mkhermitian(C *A, int rank, const bench_iodim *dim, int stride);
cannam@167 39 void mkhermitian1(C *a, int n);
cannam@167 40 void aadd(C *c, C *a, C *b, int n);
cannam@167 41 void asub(C *c, C *a, C *b, int n);
cannam@167 42 void arol(C *b, C *a, int n, int nb, int na);
cannam@167 43 void aphase_shift(C *b, C *a, int n, int nb, int na, double sign);
cannam@167 44 void ascale(C *a, C alpha, int n);
cannam@167 45 double acmp(C *a, C *b, int n, const char *test, double tol);
cannam@167 46 double mydrand(void);
cannam@167 47 double impulse(dofft_closure *k,
cannam@167 48 int n, int vecn,
cannam@167 49 C *inA, C *inB, C *inC,
cannam@167 50 C *outA, C *outB, C *outC,
cannam@167 51 C *tmp, int rounds, double tol);
cannam@167 52 double linear(dofft_closure *k, int realp,
cannam@167 53 int n, C *inA, C *inB, C *inC, C *outA,
cannam@167 54 C *outB, C *outC, C *tmp, int rounds, double tol);
cannam@167 55 void preserves_input(dofft_closure *k, aconstrain constrain,
cannam@167 56 int n, C *inA, C *inB, C *outB, int rounds);
cannam@167 57
cannam@167 58 enum { TIME_SHIFT, FREQ_SHIFT };
cannam@167 59 double tf_shift(dofft_closure *k, int realp, const bench_tensor *sz,
cannam@167 60 int n, int vecn, double sign,
cannam@167 61 C *inA, C *inB, C *outA, C *outB, C *tmp,
cannam@167 62 int rounds, double tol, int which_shift);
cannam@167 63
cannam@167 64 typedef struct dotens2_closure_s {
cannam@167 65 void (*apply)(struct dotens2_closure_s *k,
cannam@167 66 int indx0, int ondx0, int indx1, int ondx1);
cannam@167 67 } dotens2_closure;
cannam@167 68
cannam@167 69 void bench_dotens2(const bench_tensor *sz0,
cannam@167 70 const bench_tensor *sz1, dotens2_closure *k);
cannam@167 71
cannam@167 72 void accuracy_test(dofft_closure *k, aconstrain constrain,
cannam@167 73 int sign, int n, C *a, C *b, int rounds, int impulse_rounds,
cannam@167 74 double t[6]);
cannam@167 75
cannam@167 76 void accuracy_dft(bench_problem *p, int rounds, int impulse_rounds,
cannam@167 77 double t[6]);
cannam@167 78 void accuracy_rdft2(bench_problem *p, int rounds, int impulse_rounds,
cannam@167 79 double t[6]);
cannam@167 80 void accuracy_r2r(bench_problem *p, int rounds, int impulse_rounds,
cannam@167 81 double t[6]);
cannam@167 82
cannam@167 83 #if defined(BENCHFFT_LDOUBLE) && HAVE_COSL
cannam@167 84 typedef long double trigreal;
cannam@167 85 # define COS cosl
cannam@167 86 # define SIN sinl
cannam@167 87 # define TAN tanl
cannam@167 88 # define KTRIG(x) (x##L)
cannam@167 89 #elif defined(BENCHFFT_QUAD) && HAVE_LIBQUADMATH
cannam@167 90 typedef __float128 trigreal;
cannam@167 91 # define COS cosq
cannam@167 92 # define SIN sinq
cannam@167 93 # define TAN tanq
cannam@167 94 # define KTRIG(x) (x##Q)
cannam@167 95 extern trigreal cosq(trigreal);
cannam@167 96 extern trigreal sinq(trigreal);
cannam@167 97 extern trigreal tanq(trigreal);
cannam@167 98 #else
cannam@167 99 typedef double trigreal;
cannam@167 100 # define COS cos
cannam@167 101 # define SIN sin
cannam@167 102 # define TAN tan
cannam@167 103 # define KTRIG(x) (x)
cannam@167 104 #endif
cannam@167 105 #define K2PI KTRIG(6.2831853071795864769252867665590057683943388)