@@ -146,12 +146,6 @@ def test_byte_array_arguments():
146
146
147
147
assert all (output_arg1 == arg1 )
148
148
149
- dest = np .zeros_like (arg1 )
150
-
151
- cfunc .memcpy_dtoh (dest , output [0 ])
152
-
153
- assert all (dest == arg1 )
154
-
155
149
156
150
@patch ("kernel_tuner.backends.compiler.subprocess" )
157
151
@patch ("kernel_tuner.backends.compiler.numpy.ctypeslib" )
@@ -226,111 +220,6 @@ def test_memset():
226
220
assert all (x == np .zeros (4 ))
227
221
228
222
229
- @skip_if_no_cupy
230
- def test_memcpy_dtoh ():
231
- import cupy as cp
232
-
233
- a = [1 , 2 , 3 , 4 ]
234
- x = cp .asarray (a , dtype = np .float32 )
235
- x_c = C .c_void_p (x .data .ptr )
236
- arg = Argument (numpy = x , ctypes = x_c )
237
- output = np .zeros (len (x ), dtype = x .dtype )
238
-
239
- cfunc = CompilerFunctions ()
240
- cfunc .memcpy_dtoh (output , arg )
241
-
242
- print (f"{ type (x )= } { x = } " )
243
- print (f"{ type (a )= } { a = } " )
244
- print (f"{ type (output )= } { output = } " )
245
-
246
- assert all (output == a )
247
- assert all (x .get () == a )
248
-
249
-
250
- @skip_if_no_gcc
251
- def test_memcpy_host_dtoh ():
252
- a = [1 , 2 , 3 , 4 ]
253
- x = np .array (a ).astype (np .float32 )
254
- x_c = x .ctypes .data_as (C .POINTER (C .c_float ))
255
- arg = Argument (numpy = x , ctypes = x_c )
256
- output = np .zeros_like (x )
257
-
258
- cfunc = CompilerFunctions ()
259
- cfunc .memcpy_dtoh (output , arg )
260
-
261
- print (a )
262
- print (output )
263
-
264
- assert all (output == a )
265
- assert all (x == a )
266
-
267
-
268
- @skip_if_no_cupy
269
- def test_memcpy_device_dtoh ():
270
- import cupy as cp
271
-
272
- a = [1 , 2 , 3 , 4 ]
273
- x = cp .asarray (a , dtype = np .float32 )
274
- x_c = C .c_void_p (x .data .ptr )
275
- arg = Argument (numpy = x , ctypes = x_c )
276
- output = cp .zeros_like (x )
277
-
278
- cfunc = CompilerFunctions ()
279
- cfunc .memcpy_dtoh (output , arg )
280
-
281
- print (f"{ type (x )= } { x = } " )
282
- print (f"{ type (a )= } { a = } " )
283
- print (f"{ type (output )= } { output = } " )
284
-
285
- assert all (output .get () == a )
286
- assert all (x .get () == a )
287
-
288
-
289
- @skip_if_no_cupy
290
- def test_memcpy_htod ():
291
- import cupy as cp
292
-
293
- a = [1 , 2 , 3 , 4 ]
294
- src = np .array (a , dtype = np .float32 )
295
- x = cp .zeros (len (src ), dtype = src .dtype )
296
- x_c = C .c_void_p (x .data .ptr )
297
- arg = Argument (numpy = x , ctypes = x_c )
298
-
299
- cfunc = CompilerFunctions ()
300
- cfunc .memcpy_htod (arg , src )
301
-
302
- assert all (arg .numpy .get () == a )
303
-
304
-
305
- def test_memcpy_host_htod ():
306
- a = [1 , 2 , 3 , 4 ]
307
- src = np .array (a ).astype (np .float32 )
308
- x = np .zeros_like (src )
309
- x_c = x .ctypes .data_as (C .POINTER (C .c_float ))
310
- arg = Argument (numpy = x , ctypes = x_c )
311
-
312
- cfunc = CompilerFunctions ()
313
- cfunc .memcpy_htod (arg , src )
314
-
315
- assert all (arg .numpy == a )
316
-
317
-
318
- @skip_if_no_cupy
319
- def test_memcpy_device_htod ():
320
- import cupy as cp
321
-
322
- a = [1 , 2 , 3 , 4 ]
323
- src = cp .array (a , dtype = np .float32 )
324
- x = cp .zeros (len (src ), dtype = src .dtype )
325
- x_c = C .c_void_p (x .data .ptr )
326
- arg = Argument (numpy = x , ctypes = x_c )
327
-
328
- cfunc = CompilerFunctions ()
329
- cfunc .memcpy_htod (arg , src )
330
-
331
- assert all (arg .numpy .get () == a )
332
-
333
-
334
223
@skip_if_no_gfortran
335
224
def test_complies_fortran_function_no_module ():
336
225
kernel_string = """
0 commit comments