#NEWLINE# def test_gufunc_building_scalar_output( self ) : #NEWLINE# #INDENT# def sum_row( inp , out ) : #NEWLINE# #INDENT# tmp = 0.0 #NEWLINE# for i in range ( inp . shape [ 0 ] ) : #NEWLINE# #INDENT# tmp += inp [ i ] #NEWLINE# #UNINDENT# out [ 0 ] = tmp #NEWLINE# #UNINDENT# ufbldr = HsaGUFuncVectorize ( sum_row , '(n)->()' ) #NEWLINE# ufbldr . add ( 'void(int32[:], int32[:])' ) #NEWLINE# ufunc = ufbldr . build_ufunc ( ) #NEWLINE# inp = np . arange ( 300 , dtype = np . int32 ) . reshape ( 100 , 3 ) #NEWLINE# out = ufunc ( inp ) #NEWLINE# for i in range ( inp . shape [ 0 ] ) : #NEWLINE# #INDENT# np . testing . assert_equal ( inp [ i ] . sum ( ) , out [ i ] )