annotate src/fftw-3.3.8/libbench2/verify.h @ 83:ae30d91d2ffe

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