Commit 7c11a631 authored by Stefan Behnel's avatar Stefan Behnel

Add more 'nogil' declarations to NumPy functions that do not require the GIL...

Add more 'nogil' declarations to NumPy functions that do not require the GIL (according to the declarations shipped by NumPy itself).
See https://github.com/numpy/numpy/pull/16170
parent bc7bef25
......@@ -378,85 +378,85 @@ cdef extern from "numpy/arrayobject.h":
void* PyArray_DATA(ndarray) nogil
char* PyArray_BYTES(ndarray) nogil
npy_intp* PyArray_DIMS(ndarray)
npy_intp* PyArray_STRIDES(ndarray)
npy_intp PyArray_DIM(ndarray, size_t)
npy_intp PyArray_STRIDE(ndarray, size_t)
npy_intp* PyArray_DIMS(ndarray) nogil
npy_intp* PyArray_STRIDES(ndarray) nogil
npy_intp PyArray_DIM(ndarray, size_t) nogil
npy_intp PyArray_STRIDE(ndarray, size_t) nogil
PyObject *PyArray_BASE(ndarray) # returns borrowed reference!
PyArray_Descr *PyArray_DESCR(ndarray) # returns borrowed reference to dtype!
int PyArray_FLAGS(ndarray)
npy_intp PyArray_ITEMSIZE(ndarray)
int PyArray_TYPE(ndarray arr)
npy_intp PyArray_ITEMSIZE(ndarray) nogil
int PyArray_TYPE(ndarray arr) nogil
object PyArray_GETITEM(ndarray arr, void *itemptr)
int PyArray_SETITEM(ndarray arr, void *itemptr, object obj)
bint PyTypeNum_ISBOOL(int)
bint PyTypeNum_ISUNSIGNED(int)
bint PyTypeNum_ISSIGNED(int)
bint PyTypeNum_ISINTEGER(int)
bint PyTypeNum_ISFLOAT(int)
bint PyTypeNum_ISNUMBER(int)
bint PyTypeNum_ISSTRING(int)
bint PyTypeNum_ISCOMPLEX(int)
bint PyTypeNum_ISPYTHON(int)
bint PyTypeNum_ISFLEXIBLE(int)
bint PyTypeNum_ISUSERDEF(int)
bint PyTypeNum_ISEXTENDED(int)
bint PyTypeNum_ISOBJECT(int)
bint PyDataType_ISBOOL(dtype)
bint PyDataType_ISUNSIGNED(dtype)
bint PyDataType_ISSIGNED(dtype)
bint PyDataType_ISINTEGER(dtype)
bint PyDataType_ISFLOAT(dtype)
bint PyDataType_ISNUMBER(dtype)
bint PyDataType_ISSTRING(dtype)
bint PyDataType_ISCOMPLEX(dtype)
bint PyDataType_ISPYTHON(dtype)
bint PyDataType_ISFLEXIBLE(dtype)
bint PyDataType_ISUSERDEF(dtype)
bint PyDataType_ISEXTENDED(dtype)
bint PyDataType_ISOBJECT(dtype)
bint PyDataType_HASFIELDS(dtype)
bint PyDataType_HASSUBARRAY(dtype)
bint PyArray_ISBOOL(ndarray)
bint PyArray_ISUNSIGNED(ndarray)
bint PyArray_ISSIGNED(ndarray)
bint PyArray_ISINTEGER(ndarray)
bint PyArray_ISFLOAT(ndarray)
bint PyArray_ISNUMBER(ndarray)
bint PyArray_ISSTRING(ndarray)
bint PyArray_ISCOMPLEX(ndarray)
bint PyArray_ISPYTHON(ndarray)
bint PyArray_ISFLEXIBLE(ndarray)
bint PyArray_ISUSERDEF(ndarray)
bint PyArray_ISEXTENDED(ndarray)
bint PyArray_ISOBJECT(ndarray)
bint PyArray_HASFIELDS(ndarray)
bint PyArray_ISVARIABLE(ndarray)
bint PyArray_SAFEALIGNEDCOPY(ndarray)
bint PyArray_ISNBO(char) # works on ndarray.byteorder
bint PyArray_IsNativeByteOrder(char) # works on ndarray.byteorder
bint PyArray_ISNOTSWAPPED(ndarray)
bint PyArray_ISBYTESWAPPED(ndarray)
bint PyArray_FLAGSWAP(ndarray, int)
bint PyArray_ISCARRAY(ndarray)
bint PyArray_ISCARRAY_RO(ndarray)
bint PyArray_ISFARRAY(ndarray)
bint PyArray_ISFARRAY_RO(ndarray)
bint PyArray_ISBEHAVED(ndarray)
bint PyArray_ISBEHAVED_RO(ndarray)
bint PyDataType_ISNOTSWAPPED(dtype)
bint PyDataType_ISBYTESWAPPED(dtype)
bint PyTypeNum_ISBOOL(int) nogil
bint PyTypeNum_ISUNSIGNED(int) nogil
bint PyTypeNum_ISSIGNED(int) nogil
bint PyTypeNum_ISINTEGER(int) nogil
bint PyTypeNum_ISFLOAT(int) nogil
bint PyTypeNum_ISNUMBER(int) nogil
bint PyTypeNum_ISSTRING(int) nogil
bint PyTypeNum_ISCOMPLEX(int) nogil
bint PyTypeNum_ISPYTHON(int) nogil
bint PyTypeNum_ISFLEXIBLE(int) nogil
bint PyTypeNum_ISUSERDEF(int) nogil
bint PyTypeNum_ISEXTENDED(int) nogil
bint PyTypeNum_ISOBJECT(int) nogil
bint PyDataType_ISBOOL(dtype) nogil
bint PyDataType_ISUNSIGNED(dtype) nogil
bint PyDataType_ISSIGNED(dtype) nogil
bint PyDataType_ISINTEGER(dtype) nogil
bint PyDataType_ISFLOAT(dtype) nogil
bint PyDataType_ISNUMBER(dtype) nogil
bint PyDataType_ISSTRING(dtype) nogil
bint PyDataType_ISCOMPLEX(dtype) nogil
bint PyDataType_ISPYTHON(dtype) nogil
bint PyDataType_ISFLEXIBLE(dtype) nogil
bint PyDataType_ISUSERDEF(dtype) nogil
bint PyDataType_ISEXTENDED(dtype) nogil
bint PyDataType_ISOBJECT(dtype) nogil
bint PyDataType_HASFIELDS(dtype) nogil
bint PyDataType_HASSUBARRAY(dtype) nogil
bint PyArray_ISBOOL(ndarray) nogil
bint PyArray_ISUNSIGNED(ndarray) nogil
bint PyArray_ISSIGNED(ndarray) nogil
bint PyArray_ISINTEGER(ndarray) nogil
bint PyArray_ISFLOAT(ndarray) nogil
bint PyArray_ISNUMBER(ndarray) nogil
bint PyArray_ISSTRING(ndarray) nogil
bint PyArray_ISCOMPLEX(ndarray) nogil
bint PyArray_ISPYTHON(ndarray) nogil
bint PyArray_ISFLEXIBLE(ndarray) nogil
bint PyArray_ISUSERDEF(ndarray) nogil
bint PyArray_ISEXTENDED(ndarray) nogil
bint PyArray_ISOBJECT(ndarray) nogil
bint PyArray_HASFIELDS(ndarray) nogil
bint PyArray_ISVARIABLE(ndarray) nogil
bint PyArray_SAFEALIGNEDCOPY(ndarray) nogil
bint PyArray_ISNBO(char) nogil # works on ndarray.byteorder
bint PyArray_IsNativeByteOrder(char) nogil # works on ndarray.byteorder
bint PyArray_ISNOTSWAPPED(ndarray) nogil
bint PyArray_ISBYTESWAPPED(ndarray) nogil
bint PyArray_FLAGSWAP(ndarray, int) nogil
bint PyArray_ISCARRAY(ndarray) nogil
bint PyArray_ISCARRAY_RO(ndarray) nogil
bint PyArray_ISFARRAY(ndarray) nogil
bint PyArray_ISFARRAY_RO(ndarray) nogil
bint PyArray_ISBEHAVED(ndarray) nogil
bint PyArray_ISBEHAVED_RO(ndarray) nogil
bint PyDataType_ISNOTSWAPPED(dtype) nogil
bint PyDataType_ISBYTESWAPPED(dtype) nogil
bint PyArray_DescrCheck(object)
......@@ -471,15 +471,16 @@ cdef extern from "numpy/arrayobject.h":
bint PyArray_IsZeroDim(object)
# Cannot be supported due to ## ## in macro:
# bint PyArray_IsScalar(object, verbatim work)
bint PyArray_CheckScalar(object)
bint PyArray_IsPythonNumber(object)
bint PyArray_IsPythonScalar(object)
bint PyArray_IsAnyScalar(object)
bint PyArray_CheckAnyScalar(object)
ndarray PyArray_GETCONTIGUOUS(ndarray)
bint PyArray_SAMESHAPE(ndarray, ndarray)
bint PyArray_CheckScalar(object) nogil
bint PyArray_IsPythonNumber(object) nogil
bint PyArray_IsPythonScalar(object) nogil
bint PyArray_IsAnyScalar(object) nogil
bint PyArray_CheckAnyScalar(object) nogil
ndarray PyArray_GETCONTIGUOUS(ndarray) nogil
bint PyArray_SAMESHAPE(ndarray, ndarray) nogil
npy_intp PyArray_SIZE(ndarray) nogil
npy_intp PyArray_NBYTES(ndarray)
npy_intp PyArray_NBYTES(ndarray) nogil
object PyArray_FROM_O(object)
object PyArray_FROM_OF(object m, int flags)
......@@ -492,16 +493,16 @@ cdef extern from "numpy/arrayobject.h":
npy_intp PyArray_REFCOUNT(object)
object PyArray_ContiguousFromAny(op, int, int min_depth, int max_depth)
unsigned char PyArray_EquivArrTypes(ndarray a1, ndarray a2)
bint PyArray_EquivByteorders(int b1, int b2)
bint PyArray_EquivByteorders(int b1, int b2) nogil
object PyArray_SimpleNew(int nd, npy_intp* dims, int typenum)
object PyArray_SimpleNewFromData(int nd, npy_intp* dims, int typenum, void* data)
#object PyArray_SimpleNewFromDescr(int nd, npy_intp* dims, dtype descr)
object PyArray_ToScalar(void* data, ndarray arr)
void* PyArray_GETPTR1(ndarray m, npy_intp i)
void* PyArray_GETPTR2(ndarray m, npy_intp i, npy_intp j)
void* PyArray_GETPTR3(ndarray m, npy_intp i, npy_intp j, npy_intp k)
void* PyArray_GETPTR4(ndarray m, npy_intp i, npy_intp j, npy_intp k, npy_intp l)
void* PyArray_GETPTR1(ndarray m, npy_intp i) nogil
void* PyArray_GETPTR2(ndarray m, npy_intp i, npy_intp j) nogil
void* PyArray_GETPTR3(ndarray m, npy_intp i, npy_intp j, npy_intp k) nogil
void* PyArray_GETPTR4(ndarray m, npy_intp i, npy_intp j, npy_intp k, npy_intp l) nogil
void PyArray_XDECREF_ERR(ndarray)
# Cannot be supported due to out arg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment