From 7add97bcee029ae5269532c33b9531ebf26f89c5 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Mon, 10 Mar 2014 22:23:51 +0100 Subject: ENH: release gil for np.packbits and np.unpackbits --- numpy/lib/src/_compiled_base.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'numpy/lib/src') diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c index 652268f24..f70cd2bab 100644 --- a/numpy/lib/src/_compiled_base.c +++ b/numpy/lib/src/_compiled_base.c @@ -1417,6 +1417,9 @@ _packbits( void *In, npy_intp out_Nm1; int maxi, remain, nonzero, j; char *outptr,*inptr; + NPY_BEGIN_THREADS_DEF; + + NPY_BEGIN_THREADS_THRESHOLDED(out_N); outptr = Out; /* pointer to output buffer */ inptr = In; /* pointer to input buffer */ @@ -1451,6 +1454,8 @@ _packbits( void *In, *outptr = build; outptr += out_stride; } + + NPY_END_THREADS; return; } @@ -1468,6 +1473,9 @@ _unpackbits(void *In, unsigned char mask; int i, index; char *inptr, *outptr; + NPY_BEGIN_THREADS_DEF; + + NPY_BEGIN_THREADS_THRESHOLDED(in_N); outptr = Out; inptr = In; @@ -1480,6 +1488,8 @@ _unpackbits(void *In, } inptr += in_stride; } + + NPY_END_THREADS; return; } -- cgit v1.2.1