#NEWLINE# def test_low_workcount( self ) : #NEWLINE# #INDENT# pv = Vectorize ( vector_add , target = 'parallel' ) #NEWLINE# for ty in ( int32 , uint32 , float32 , float64 ) : #NEWLINE# #INDENT# pv . add ( ty ( ty , ty ) ) #NEWLINE# #UNINDENT# para_ufunc = pv . build_ufunc ( ) #NEWLINE# np_ufunc = np . vectorize ( vector_add ) #NEWLINE# def test( ty ) : #NEWLINE# #INDENT# data = np . arange ( 1 ) . astype ( ty ) #NEWLINE# result = para_ufunc ( data , data ) #NEWLINE# gold = np_ufunc ( data , data ) #NEWLINE# self . assertTrue ( np . allclose ( gold , result ) ) #NEWLINE# #UNINDENT# test ( np . double ) #NEWLINE# test ( np . float32 ) #NEWLINE# test ( np . int32 ) #NEWLINE# test ( np . uint32 )