<s> import numpy as np <EOL> from numba import cuda <EOL> from numba . cuda . kernels . transpose import transpose <EOL> from numba . cuda . testing import unittest <EOL> from numba . testing . ddt import ddt , data , unpack <EOL> from numba . cuda . testing import skip_on_cudasim <EOL> @ skip_on_cudasim ( '<STR_LIT>' ) <EOL> @ ddt <EOL> class Test ( unittest . TestCase ) : <EOL> @ data ( ( <NUM_LIT:5> , <NUM_LIT:6> , np . float64 ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , np . complex128 ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , np . float64 ) ) <EOL> @ unpack <EOL> def test_transpose ( self , rows , cols , dtype ) : <EOL> x = np . arange ( rows * cols , dtype = dtype ) . reshape ( cols , rows ) <EOL> y = np . zeros ( rows * cols , dtype = dtype ) . reshape ( rows , cols ) <EOL> dx = cuda . to_device ( x ) <EOL> dy = cuda . cudadrv . devicearray . from_array_like ( y ) <EOL> transpose ( dx , dy ) <EOL> dy . copy_to_host ( y ) <EOL> self . assertTrue ( np . all ( x . transpose ( ) == y ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
