#NEWLINE# def test_cublasSgemv( self ) : #NEWLINE# #INDENT# a = np . random . rand ( 2 , 3 ) . astype ( np . float32 ) #NEWLINE# x = np . random . rand ( 3 , 1 ) . astype ( np . float32 ) #NEWLINE# a_gpu = gpuarray . to_gpu ( a . T . copy ( ) ) #NEWLINE# x_gpu = gpuarray . to_gpu ( x ) #NEWLINE# y_gpu = gpuarray . empty ( ( 2 , 1 ) , np . float32 ) #NEWLINE# alpha = np . float32 ( 1.0 ) #NEWLINE# beta = np . float32 ( 0.0 ) #NEWLINE# cublas . cublasSgemv ( self . cublas_handle , 'n' , 2 , 3 , alpha , a_gpu . gpudata , 2 , x_gpu . gpudata , 1 , beta , y_gpu . gpudata , 1 ) #NEWLINE# assert np . allclose ( y_gpu . get ( ) , np . dot ( a , a_gpu ) )