I am trying to parallelize a function using the @guvectorize decorator. The function takes multiple inputs and should generate multiple outputs of which each has a different shape. My code (reproduced in part below) runs without any errors, yet, the values of the second output parameter are not returned to the location where I call the vectorized function.
My question is:
- How do I get the function rotate_GPU to return the values of
rot_data
androt_or
and not only the values ofrot_data
as it does currently?
dat, rot = rotate_GPU(dat, rot, dtheta)
@guvectorize(['(float64[:,:], float64[:], float64, float64[:,:],float64[:])'],
'(n,m),(p),()->(n,m),(p)', nopython=True, target="parallel")
def rotate_GPU(data, orientation, dtheta, rot_data, rot_or):
# Several calculations taking data, orientation, dtheta in which I
# assign values to rot_data and rot_or. I have made sure that the
# dimensions of these variables agree with the signature, so that
# data.shape = (n,m)
# orientation.shape = (p)
# dtheta.shape = ()
# rot_data.shape = (n,m)
# rot_or.shape = (p)