From ca6ffc1d2c3887b05c32b89b73726f16da57a870 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Mon, 4 May 2020 21:14:28 +0200 Subject: Add nogil to EMD_wrap --- ot/lp/emd_wrap.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ot/lp/emd_wrap.pyx b/ot/lp/emd_wrap.pyx index b6bda47..c167964 100644 --- a/ot/lp/emd_wrap.pyx +++ b/ot/lp/emd_wrap.pyx @@ -19,7 +19,7 @@ import warnings cdef extern from "EMD.h": - int EMD_wrap(int n1,int n2, double *X, double *Y,double *D, double *G, double* alpha, double* beta, double *cost, int maxIter) + int EMD_wrap(int n1,int n2, double *X, double *Y,double *D, double *G, double* alpha, double* beta, double *cost, int maxIter) nogil cdef enum ProblemType: INFEASIBLE, OPTIMAL, UNBOUNDED, MAX_ITER_REACHED @@ -110,7 +110,8 @@ def emd_c(np.ndarray[double, ndim=1, mode="c"] a, np.ndarray[double, ndim=1, mod G=np.zeros([n1, n2]) # calling the function - result_code = EMD_wrap(n1, n2, a.data, b.data, M.data, G.data, alpha.data, beta.data, &cost, max_iter) + with nogil: + result_code = EMD_wrap(n1, n2, a.data, b.data, M.data, G.data, alpha.data, beta.data, &cost, max_iter) return G, cost, alpha, beta, result_code -- cgit v1.2.3