def run_unpack_to_cf32_test(self, iarray): oarray = bf.ndarray(shape=iarray.shape, dtype='cf32') oarray_known = bf.ndarray( [[0 + 1j, 2 + 3j], [4 + 5j, 6 + 7j], [-8 - 7j, -6 - 5j]], dtype='cf32') bf.unpack(iarray, oarray) np.testing.assert_equal(oarray, oarray_known)
def run_unpack_to_ci8_test(self, iarray): oarray = bf.ndarray(shape=iarray.shape, dtype='ci8') oarray_known = bf.ndarray([[(0, 1), (2, 3)], [(4, 5), (6, 7)], [(-8, -7), (-6, -5)]], dtype='ci8') bf.unpack(iarray, oarray) np.testing.assert_equal(oarray, oarray_known)
def run_unpack_to_ci8_test(self, iarray): oarray = bf.ndarray(shape=iarray.shape, dtype='ci8', space='cuda_managed') oarray_known = bf.ndarray([[(0, 1), (2, 3)], [(4, 5), (6, 7)], [(-8, -7), (-6, -5)]], dtype='ci8') bf.unpack(iarray.copy(space='cuda_managed'), oarray) stream_synchronize() np.testing.assert_equal(oarray, oarray_known)