@@ -181,10 +181,10 @@ int run_test(int method, int type, int N1, int N2, int M, T tol, T checktol, int
181181 const int nt2 = 0.26 * N2; // choose some mode index to check
182182 thrust::complex <T> Ft = thrust::complex <T>(0 , 0 ), J = thrust::complex <T>(0.0 , iflag);
183183 for (int j = 0 ; j < M; ++j)
184- Ft += c[j] * exp (J * (nt1 * x[j] + nt2 * y[j])); // crude direct
185- const int it = N1 / 2 + nt1 + N1 * (N2 / 2 + nt2); // index in complex F as 1d
186- // array
187- rel_error = std ::abs (Ft - fk[it]) / infnorm (N1, (std::complex <T> *)fk.data ());
184+ Ft += c[j] * thrust:: exp (J * (nt1 * x[j] + nt2 * y[j])); // crude direct
185+ const int it = N1 / 2 + nt1 + N1 * (N2 / 2 + nt2); // index in complex F as 1d
186+ // array
187+ rel_error = thrust ::abs (Ft - fk[it]) / infnorm (N1, (std::complex <T> *)fk.data ());
188188 printf (" [gpu ] one mode: rel err in F[%d,%d] is %.3g\n " , nt1, nt2, rel_error);
189189 if (type == 1 && static_cast <int64_t >(M) * N1 * N2 <= TEST_BIGPROB) {
190190 std::vector<thrust::complex <T>> Ft (N1 * N2);
@@ -201,9 +201,9 @@ int run_test(int method, int type, int N1, int N2, int M, T tol, T checktol, int
201201 int m = 0 ;
202202 for (int m2 = -(N2 / 2 ); m2 <= (N2 - 1 ) / 2 ; ++m2) // loop in correct order over F
203203 for (int m1 = -(N1 / 2 ); m1 <= (N1 - 1 ) / 2 ; ++m1)
204- ct += fk[m++] * exp (J * (m1 * x[jt] + m2 * y[jt])); // crude direct
204+ ct += fk[m++] * thrust:: exp (J * (m1 * x[jt] + m2 * y[jt])); // crude direct
205205
206- rel_error = std ::abs (c[jt] - ct) / infnorm (M, (std::complex <T> *)c.data ());
206+ rel_error = thrust ::abs (c[jt] - ct) / infnorm (M, (std::complex <T> *)c.data ());
207207 printf (" [gpu ] one targ: rel err in c[%d] is %.3g\n " , jt, rel_error);
208208 if (type == 2 && static_cast <int64_t >(M) * N1 * N2 <= TEST_BIGPROB) {
209209 std::vector<thrust::complex <T>> ct (M);
@@ -219,9 +219,9 @@ int run_test(int method, int type, int N1, int N2, int M, T tol, T checktol, int
219219 thrust::complex <T> Ft = thrust::complex <T>(0 , 0 );
220220
221221 for (int j = 0 ; j < M; ++j) {
222- Ft += c[j] * exp (J * (x[j] * s[jt] + y[j] * t[jt]));
222+ Ft += c[j] * thrust:: exp (J * (x[j] * s[jt] + y[j] * t[jt]));
223223 }
224- rel_error = std ::abs (Ft - fk[jt]) / infnorm (N1 * N2, (std::complex <T> *)fk.data ());
224+ rel_error = thrust ::abs (Ft - fk[jt]) / infnorm (N1 * N2, (std::complex <T> *)fk.data ());
225225 printf (" [gpu ] one mode: rel err in F[%d] is %.3g\n " , jt, rel_error);
226226 if (type == 3 && static_cast <int64_t >(M) * N1 * N2 <= TEST_BIGPROB) {
227227 std::vector<thrust::complex <T>> Ft (N1 * N2);
0 commit comments