@@ -0,0 +1,1027 @@
+from __future__ import print_function, absolute_import, division%0A%0Afrom numba import unittest_support as unittest%0Aimport numpy as np%0Afrom numba import cuda%0A%0A%0Adef reinterpret_array_type(byte_arr, start, stop, output):%0A    # Tested with just one thread%0A    val = byte_arr%5Bstart:stop%5D.view(np.int32)%5B0%5D%0A    output%5B0%5D = val%0A%0A%0Aclass TestCudaArrayMethods(unittest.TestCase):%0A    def test_reinterpret_array_type(self):%0A        %22%22%22%0A        Reinterpret byte array as int32 in the GPU.%0A        %22%22%22%0A        pyfunc = reinterpret_array_type%0A        kernel = cuda.jit(pyfunc)%0A%0A        byte_arr = np.arange(256, dtype=np.uint8)%0A        itemsize = np.dtype(np.int32).itemsize%0A        for start in range(0, 256, itemsize):%0A            stop = start + itemsize%0A            expect = byte_arr%5Bstart:stop%5D.view(np.int32)%5B0%5D%0A%0A            output = np.zeros(1, dtype=np.int32)%0A            kernel%5B1, 1%5D(byte_arr, start, stop, output)%0A%0A            got = output%5B0%5D%0A            self.assertEqual(expect, got)%0A%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

Add CUDA GPU test for the .view() array method