import cython cimport cython ctypedef fused real: cython.short cython.ushort cython.int cython.uint cython.long cython.ulong cython.longlong cython.ulonglong cython.float cython.double cdef extern from "" namespace "__gnu_parallel": cdef void sort[T](T first, T last) nogil @cython.boundscheck(False) # turn off bounds-checking for entire function @cython.wraparound(False) # turn off negative index wrapping for entire function def parallelsort(real[:] a): """ In-place parallel sort for numpy types """ sort(&a[0], &a[a.shape[0]])