Dear all,
I am trying to parallelize the following function:
@numba.guvectorize([(numba.float64[:,:], numba.int32, numba.int32, numba.float64[:,:])],
'(n,m),(),()->(p,q)')
def my_func(array, int1, int2, res):
for x in range(int1):
for y in range(int2):
# DO MANY HEAVY COMPUTATION THAT REQUIRES THE WHOLE ARRAY AND POSITION X AND Y. Note that array shape (n,2) is independent of result shape (which basically depends on the spatial resolution I want)
res[y, x] = my_result
My problem is that the resulting function has size (int1, int2) but for some reason if p and q are not the same size as the input it throws an error. Is there a way of having a result with an arbitrary size (after all it is an input of the function so it could dynamically allocate memory)?
Thank you for your help,
Jules