I’m trying to accelerate my code using numba.
I wrote a jit decorated function that is correctly compiled when “parallel=False”, but it doesn’t when “parallel=True”.
This is my function:
@jit(nopython=True, parallel=True, cache=True)
def I_obj_func(y_bar,ni,beta):
I_func = np.empty((2,beta.shape[0]),dtype=np.float64)
for k in prange(2):
D_a_k_conj_diag = np.exp(-1j*2*np.pi/P*ni[k]*np.arange(P))
Ryy_conj_cycl_tmp = np.zeros((P,P), dtype=np.complex128)
for j in prange(J):
for r in prange(-1,2):
Ryy_conj_cycl_tmp += np.exp(1j*2*np.pi*ni[k]*r)*cycl_conj_corr(y_bar[j],2*ni[k],r)
Phi_a_k = np.expand_dims(D_a_k_conj_diag,-1) * Ryy_conj_cycl_tmp * D_a_k_conj_diag
phi_a_k = np.diag(W_p.conj().T @ Phi_a_k @ W_p.conj())
tmp = phi_a_k[:P//2]*upsilon.conj()[:P//2]
for idx in prange(beta.shape[0]):
I_func[k,idx] = np.abs(np.sum(tmp*np.exp(1j*4*np.pi/Ts*beta[idx]*np.arange(P//2))))
return I_func
and this is the compilation error:
LoweringError: '$push_global_to_block.74504'
Please, let me know If you need more information.
Thanks a lot.
Ivan