@@ -84,3 +84,39 @@ def test_simple_type2(to_gpu, to_cpu, dtype, shape, n_trans, M, tol, output_arg)
84
84
c = to_cpu (c_gpu )
85
85
86
86
utils .verify_type2 (k , fk , c , tol )
87
+
88
+
89
+ @pytest .mark .parametrize ("dtype" , DTYPES )
90
+ @pytest .mark .parametrize ("dim" , list (set (len (shape ) for shape in SHAPES )))
91
+ @pytest .mark .parametrize ("n_source_pts" , MS )
92
+ @pytest .mark .parametrize ("n_target_pts" , MS )
93
+ @pytest .mark .parametrize ("n_trans" , N_TRANS )
94
+ @pytest .mark .parametrize ("tol" , TOLS )
95
+ @pytest .mark .parametrize ("output_arg" , OUTPUT_ARGS )
96
+ def test_cufinufft3_simple (to_gpu , to_cpu , dtype , dim , n_source_pts , n_target_pts , n_trans , tol , output_arg ):
97
+ complex_dtype = utils ._complex_dtype (dtype )
98
+
99
+ fun = {1 : cufinufft .nufft1d3 ,
100
+ 2 : cufinufft .nufft2d3 ,
101
+ 3 : cufinufft .nufft3d3 }[dim ]
102
+
103
+ source_pts , source_coefs , target_pts = utils .type3_problem (
104
+ complex_dtype , dim , n_source_pts , n_target_pts , n_trans
105
+ )
106
+
107
+
108
+ source_pts_gpu = to_gpu (source_pts )
109
+ source_coefs_gpu = to_gpu (source_coefs )
110
+ target_pts_gpu = to_gpu (target_pts )
111
+
112
+ if output_arg :
113
+ target_coefs_gpu = _compat .array_empty_like (
114
+ source_coefs_gpu , n_trans + (n_target_pts ,), dtype = complex_dtype )
115
+
116
+ fun (* source_pts_gpu , source_coefs_gpu , * target_pts_gpu , out = target_coefs_gpu , eps = tol )
117
+ else :
118
+ target_coefs_gpu = fun (* source_pts_gpu , source_coefs_gpu , * target_pts_gpu , eps = tol )
119
+
120
+ target_coefs = to_cpu (target_coefs_gpu )
121
+
122
+ utils .verify_type3 (source_pts , source_coefs , target_pts , target_coefs , tol )
0 commit comments