Python numba: how to find position of the largest element in array -
i'm writing code real-time processing of image camera. using python 3.5 anaconda accelerate/numba packages perform of calculations on gpu. have problems implementing function find position of largest element in float32 2d array. array in gpu memory. problem is: terribly slow. bottleneck of whole code. code:
@n_cuda.jit('void(float32[:,:], float32, float32, float32)') def d_findcarpeak(temp_mat, height, width, peak_flat): row, col = cuda.grid(2) if row < height , col < width: peak_flat = temp_mat.argmax()
here call it:
d_findcarpeak[number_of_blocks, threads_per_block]( d_temp_mat, height, width, d_peak_flat)
how can rewrite code?
Comments
Post a Comment