summaryrefslogtreecommitdiff
path: root/numpy/lib/src
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-03-10 22:23:51 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-03-11 20:48:38 +0100
commit7add97bcee029ae5269532c33b9531ebf26f89c5 (patch)
treef6625e62ac2c3725887b666c267d2d56e00567cf /numpy/lib/src
parentd62c4357b263e8b0cbae9210d5bbe467ddf262b2 (diff)
downloadnumpy-7add97bcee029ae5269532c33b9531ebf26f89c5.tar.gz
ENH: release gil for np.packbits and np.unpackbits
Diffstat (limited to 'numpy/lib/src')
-rw-r--r--numpy/lib/src/_compiled_base.c10
1 files changed, 10 insertions, 0 deletions
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;
}