Reputation: 630
I dont understand why this does not compile. _svd returns a double*, and I am assigning it to a double*.
Error Message: Coercion from Python not allowed without the GIL
cpdef svd(A_f, m, n):
cdef double *S_p
with nogil:
S_p = _svd(A_f, m, n)
return <double[:min(m, n)]> S_p
cdef double* _svd(double[:] A_f, int m, int n) nogil:
#code removed bc it is long
Edit: It works with the GIL, but I want to call it without the GIL.
Upvotes: 1
Views: 396
Reputation: 21767
Try this
cpdef svd(A_f, int m, int n):
cdef double *S_p
cdef double[:] abc = A_f
with nogil:
S_p = _svd(abc , m, n)
Upvotes: 1