annotate fft/fftw/fftw-3.3.4/libbench2/verify.h @ 40:223f770b5341 kissfft-double tip

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