We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3ea387 commit 1aa1461Copy full SHA for 1aa1461
test/test_c_functions.py
@@ -71,6 +71,25 @@ def test_ready_argument_list4():
71
cfunc = CFunctions()
72
cfunc.ready_argument_list([arg1])
73
74
+def test_byte_array_arguments():
75
+ arg1 = numpy.array([1, 2, 3]).astype(numpy.int8)
76
+
77
+ cfunc = CFunctions()
78
79
+ output = cfunc.ready_argument_list([arg1])
80
81
+ output_arg1 = numpy.ctypeslib.as_array(output[0], shape=arg1.shape)
82
83
+ assert output_arg1.dtype == 'int8'
84
85
+ assert all(output_arg1 == arg1)
86
87
+ dest = numpy.zeros_like(arg1)
88
89
+ cfunc.memcpy_dtoh(dest, output[0])
90
91
+ assert all(dest == arg1)
92
93
94
@patch('kernel_tuner.c.subprocess')
95
@patch('kernel_tuner.c.numpy.ctypeslib')
0 commit comments