How does Numba calculate number of parallel threads required to perform a function in parallel

0 views
Skip to first unread message

aseem hegshetye

unread,
May 12, 2017, 3:35:09 AM5/12/17
to Numba Public Discussion - Public
If output target is scaler, how does numba know the number of parallel threads required to be created to compute the following code: This code is on Numba github : https://github.com/ContinuumIO/numbapro-examples/blob/master/guvectorize/sumrows.py



@guvectorize(['void(int32[:], int32[:])'], '(n)->()', target='cuda')
def sum_row(inp, out):
   tmp = 0.
   for i in range(inp.shape[0]):
       tmp += inp[i]
   out[0] = tmp

Does numba work based on for loops in guvectorize function and create number of parallel processes equal to the number of iterations in for loop.
Reply all
Reply to author
Forward
0 new messages