-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
prange
seems to hold forever if in the loop we call a function that uses a 1d view of a 2d view. Here is a reproducing example:
import numpy as np
from cython.parallel import prange
def wrapper(): # will hold forever
a = np.random.uniform(0, 100, size=(100, 100)).astype(np.int32)
g(a)
cdef int f(int [:] a_i) nogil: # uses 1d view
return 3
cdef int g (int [:, :] a) nogil:
cdef:
int i
for i in prange(a.shape[0]): # Works OK with range
f(a[i])
As a workaround we can still pass a
and i
to f
and use a[i]
instead of a_i
.
Thanks for all the work on Cython!
Versions:
Cython 0.29.2,
Python 3.7.2