33 int bench_openmp(FILE *infile,
int n,
int m,
int p,
34 C (*kernel)(R,
int,
const R *), R c, R eps_I, R eps_B)
40 R r_max = K(0.25) - my_fastsum_plan.
eps_B / K(2.0);
44 fscanf(infile,
"%d %d %d", &d, &L, &M);
47 FFTW(import_wisdom_from_filename)(
"fastsum_benchomp_detail_threads.plan");
49 FFTW(import_wisdom_from_filename)(
"fastsum_benchomp_detail_single.plan");
56 FFTW(export_wisdom_to_filename)(
"fastsum_benchomp_detail_threads.plan");
58 FFTW(export_wisdom_to_filename)(
"fastsum_benchomp_detail_single.plan");
61 for (j = 0; j < L; j++)
63 for (t = 0; t < d; t++)
66 fscanf(infile, __FR__, &v);
67 my_fastsum_plan.
x[d * j + t] = v * r_max;
71 for (j = 0; j < L; j++)
73 fscanf(infile, __FR__
" " __FR__, &re, &im);
74 my_fastsum_plan.
alpha[j] = re + II * im;
77 for (j = 0; j < M; j++)
79 for (t = 0; t < d; t++)
82 fscanf(infile, __FR__, &v);
83 my_fastsum_plan.
y[d * j + t] = v * r_max;
94 tt_total = NFFT(elapsed_seconds)(t1, t0);
110 #ifndef MEASURE_TIME_FFTW
116 "%.6" __FES__
" %.6" __FES__
" %.6" __FES__
" %6" __FES__
" %.6" __FES__
" %.6" __FES__
" %.6" __FES__
" %.6" __FES__
" %.6" __FES__
" %6" __FES__
" %.6" __FES__
" %.6" __FES__
" %6" __FES__
" %.6" __FES__
" %.6" __FES__
" %6" __FES__
"\n",
141 int main(
int argc,
char **argv)
147 C (*kernel)(R, int,
const R *);
158 nthreads = atoi(argv[8]);
159 FFTW(init_threads)();
160 omp_set_num_threads(nthreads);
171 eps_I = (R)(atof(argv[6]));
172 eps_B = (R)(atof(argv[7]));
173 if (strcmp(s,
"gaussian") == 0)
175 else if (strcmp(s,
"multiquadric") == 0)
176 kernel = multiquadric;
177 else if (strcmp(s,
"inverse_multiquadric") == 0)
178 kernel = inverse_multiquadric;
179 else if (strcmp(s,
"logarithm") == 0)
181 else if (strcmp(s,
"thinplate_spline") == 0)
182 kernel = thinplate_spline;
183 else if (strcmp(s,
"one_over_square") == 0)
184 kernel = one_over_square;
185 else if (strcmp(s,
"one_over_modulus") == 0)
186 kernel = one_over_modulus;
187 else if (strcmp(s,
"one_over_x") == 0)
189 else if (strcmp(s,
"inverse_multiquadric3") == 0)
190 kernel = inverse_multiquadric3;
191 else if (strcmp(s,
"sinc_kernel") == 0)
192 kernel = sinc_kernel;
193 else if (strcmp(s,
"cosc") == 0)
195 else if (strcmp(s,
"cot") == 0)
200 kernel = multiquadric;
203 bench_openmp(stdin, n, m, p, kernel, c, eps_I, eps_B);
Header file with predefined kernels for the fast summation algorithm.
plan for fast summation algorithm
Header file for the fast NFFT-based summation algorithm.
C * alpha
source coefficients
void fastsum_trafo(fastsum_plan *ths)
fast NFFT-based summation
void fastsum_precompute(fastsum_plan *ths)
precomputation for fastsum
R MEASURE_TIME_t[8]
Measured time for each step if MEASURE_TIME is set.
void fastsum_init_guru(fastsum_plan *ths, int d, int N_total, int M_total, kernel k, R *param, unsigned flags, int nn, int m, int p, R eps_I, R eps_B)
initialization of fastsum plan
R * y
target knots in d-ball with radius 1/4-eps_b/2
void fastsum_finalize(fastsum_plan *ths)
finalization of fastsum plan
R * x
source knots in d-ball with radius 1/4-eps_b/2