#NEWLINE# def test_atomic_add_float( self ) : #NEWLINE# #INDENT# ary = np . random . randint ( 0 , 32 , size = 32 ) . astype ( np . float32 ) #NEWLINE# orig = ary . copy ( ) #NEWLINE# cuda_atomic_add_float = cuda . jit ( 'void(float32[:])' ) ( atomic_add_float ) #NEWLINE# cuda_atomic_add_float [ ( 1 , 32 ) ] ( ary ) #NEWLINE# gold = np . zeros ( 32 , dtype = np . uint32 ) #NEWLINE# for i in range ( orig . size ) : #NEWLINE# #INDENT# gold [ orig [ i ] ] += 1.0 #NEWLINE# #UNINDENT# self . assertTrue ( np . all ( ( ary == gold ) ) )