#NEWLINE# def test_cublasStrsmBatched( self ) : #NEWLINE# #INDENT# ( l , m , n ) = ( 11 , 7 , 5 ) #NEWLINE# A = np . random . rand ( l , m , m ) . astype ( np . float32 ) #NEWLINE# B = np . random . rand ( l , m , n ) . astype ( np . float32 ) #NEWLINE# A = np . array ( list ( map ( np . triu , A ) ) ) #NEWLINE# X = np . array ( [ np . linalg . solve ( a , b ) for ( a , b ) in zip ( A , B ) ] ) #NEWLINE# alpha = np . float32 ( 1.0 ) #NEWLINE# a_gpu = gpuarray . to_gpu ( A ) #NEWLINE# b_gpu = gpuarray . to_gpu ( B ) #NEWLINE# a_arr = bptrs ( a_gpu ) #NEWLINE# b_arr = bptrs ( b_gpu ) #NEWLINE# cublas . cublasStrsmBatched ( self . cublas_handle , 'r' , 'l' , 'n' , 'n' , n , m , a_gpu , a_arr . gpudata , m , b_arr . gpudata , n , l ) #NEWLINE# assert np . allclose ( X , b_gpu . get ( ) , 5 )