#include <fft_triadic_threads.hpp>
Definition at line 26 of file fft_triadic_threads.hpp.
typedef implementation<vector_linear,vector_naive> NVec |
Definition at line 28 of file fft_triadic_threads.hpp.
Definition at line 30 of file fft_triadic_threads.hpp.
typedef R::U U |
Definition at line 31 of file fft_triadic_threads.hpp.
typedef FFTER::V V |
Definition at line 29 of file fft_triadic_threads.hpp.
fft_triadic_threads_transformer | ( | nat | n, | |
const format< C > & | fm | |||
) | [inline] |
~fft_triadic_threads_transformer | ( | ) | [inline] |
Definition at line 45 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
00045 { delete ffter; }
static void copy | ( | CC * | d, | |
nat | drs, | |||
nat | dcs, | |||
CC * | s, | |||
nat | srs, | |||
nat | scs, | |||
nat | r, | |||
nat | c | |||
) | [inline, static] |
Definition at line 48 of file fft_triadic_threads.hpp.
Referenced by outer_fft_triadic_task_rep< CC >::execute().
void dfft_triadic | ( | CC * | c, | |
nat | stride, | |||
nat | shift, | |||
nat | steps, | |||
nat | step1, | |||
nat | step2 | |||
) | [inline] |
Definition at line 186 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
00187 { 00188 if (step1 == 0 && step2 == steps && steps > thr) 00189 fft_triadic (true, c, stride, shift, steps); 00190 else ffter->dfft_triadic (c, stride, shift, steps, step1, step2); 00191 }
void dfft_triadic | ( | CC * | c, | |
nat | stride, | |||
nat | shift, | |||
nat | steps | |||
) | [inline] |
Definition at line 174 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::direct_transform_triadic().
00174 { 00175 if (steps <= thr) ffter->dfft_triadic (c, stride, shift, steps); 00176 else fft_triadic (true, c, stride, shift, steps); 00177 }
void direct_transform_triadic | ( | C * | c | ) | [inline] |
Definition at line 202 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::depth, and fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic().
00202 { 00203 dfft_triadic (c, 1, 0, depth); 00204 }
void fft_triadic | ( | bool | direct, | |
CC * | c, | |||
nat | stride, | |||
nat | shift, | |||
nat | steps | |||
) | [inline] |
Definition at line 122 of file fft_triadic_threads.hpp.
References binpow(), fft_triadic_threads_transformer< C, FFTER, thr >::ffter, and fft_triadic_threads_transformer< C, FFTER, thr >::min_reps.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ifft_triadic().
00122 { 00123 nat nt= threads_number; 00124 nat half1= steps >> 1; 00125 nat half2= steps - half1; 00126 nat len1= binpow ((nat) 3, half1); 00127 nat len2= binpow ((nat) 3, half2); 00128 if (steps <= thr || len2 <= min_reps || nt == 1) { 00129 if (direct) ffter->dfft_triadic (c, stride, shift, steps); 00130 else ffter->ifft_triadic (c, stride, shift, steps); 00131 } 00132 else { 00133 for (nat stage=0; stage<2; stage++) { 00134 if ((stage == 0) ^ (!direct)) { 00135 // Below is multi-threaded the following loop: 00136 // C* cc1 = c; 00137 // for (nat i=0; i< len2; i++, cc1 += stride) 00138 // if (direct) 00139 // ffter->dfft_triadic (cc1, stride * len2, shift, half1); 00140 // else 00141 // ffter->ifft_triadic (cc1, stride * len2, shift, half1); 00142 nat bsz= min_reps * len1; // Recall min_reps < len2 00143 CC* buf= mmx_new<CC> (nt * bsz); 00144 task tasks[nt]; 00145 for (nat i=0; i<nt; i++) { 00146 nat sta= min_reps * (( i * len2) / (min_reps * nt)); 00147 nat end= min_reps * (((i+1) * len2) / (min_reps * nt)); 00148 tasks[i]= new outer_fft_triadic_task_rep<CC> 00149 (ffter, direct, buf + i*bsz, end-sta, len2, 00150 c + sta*stride, stride, shift / len2, half1); 00151 } 00152 threads_execute (tasks, nt); 00153 mmx_delete<CC> (buf, nt * bsz); 00154 } 00155 else { 00156 // Below is multi-threaded the following loop: 00157 // CC* cc2= c; 00158 // for (nat i=0; i<len1; i++, cc2 += stride*len2) 00159 // if (direct) 00160 // ffter->dfft_triadic (cc2, stride, shift + i*len2, half2); 00161 // else 00162 // ffter->ifft_triadic (cc2, stride, shift + i*len2, half2); 00163 task tasks[nt]; 00164 for (nat i=0; i<nt; i++) 00165 tasks[i]= new inner_fft_triadic_task_rep<CC> 00166 (ffter, direct, i, nt, len1, c, stride, shift, half2); 00167 threads_execute (tasks, nt); 00168 } 00169 } 00170 } 00171 }
void ifft_triadic | ( | CC * | c, | |
nat | stride, | |||
nat | shift, | |||
nat | steps, | |||
nat | step1, | |||
nat | step2 | |||
) | [inline] |
Definition at line 194 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
00195 { 00196 if (step1 == 0 && step2 == steps && steps > thr) 00197 fft_triadic (false, c, stride, shift, steps); 00198 else ffter->ifft_triadic (c, stride, shift, steps, step1, step2); 00199 }
void ifft_triadic | ( | CC * | c, | |
nat | stride, | |||
nat | shift, | |||
nat | steps | |||
) | [inline] |
Definition at line 180 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
00180 { 00181 if (steps <= thr) ffter->ifft_triadic (c, stride, shift, steps); 00182 else fft_triadic (false, c, stride, shift, steps); 00183 }
void inverse_transform_triadic | ( | C * | c, | |
bool | shift = true | |||
) | [inline] |
nat depth |
Definition at line 35 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::direct_transform_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
FFTER* ffter |
Definition at line 34 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic(), fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), fft_triadic_threads_transformer< C, FFTER, thr >::ifft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::~fft_triadic_threads_transformer().
nat len |
Definition at line 36 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
const nat min_reps = 27 [static] |
Definition at line 32 of file fft_triadic_threads.hpp.
Referenced by outer_fft_triadic_task_rep< CC >::execute(), and fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic().
Definition at line 37 of file fft_triadic_threads.hpp.
Definition at line 38 of file fft_triadic_threads.hpp.