Download cuda/ccudart.cpp from salmankhanpm/build-tools: direct link, hf CLI and curl.
- Browser
- Download file 244 kB
-
https://huggingface.co/salmankhanpm/build-tools/resolve/main/cuda/ccudart.cpp
- Command line
-
hf download hf://salmankhanpm/build-tools/cuda/ccudart.cpp
-
curl -L -o ccudart.cpp https://huggingface.co/salmankhanpm/build-tools/resolve/main/cuda/ccudart.cpp
244 kB
| /* Generated by Cython 3.1.5 */ | |
| /* BEGIN: Cython Metadata | |
| { | |
| "distutils": { | |
| "depends": [ | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/cuda_runtime_api.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/device_types.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/driver_types.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/library_types.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/surface_types.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/texture_types.h", | |
| "/host/home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include/vector_types.h" | |
| ], | |
| "extra_compile_args": [ | |
| "-std=c++14", | |
| "-fpermissive", | |
| "-Wno-deprecated-declarations", | |
| "-fno-var-tracking-assignments", | |
| "-O3" | |
| ], | |
| "include_dirs": [ | |
| "/opt/python/cp312-cp312/include", | |
| "/host//home/runner/_work/cuda-python/cuda-python/cuda_toolkit/include" | |
| ], | |
| "language": "c++", | |
| "library_dirs": [ | |
| "/tmp/build-env-3t3_8d9r/lib/python3.12/site-packages", | |
| "/tmp/build-env-3t3_8d9r/lib", | |
| "/host//home/runner/_work/cuda-python/cuda-python/cuda_toolkit/lib64", | |
| "/host//home/runner/_work/cuda-python/cuda-python/cuda_toolkit/lib" | |
| ], | |
| "name": "cuda.ccudart", | |
| "sources": [ | |
| "cuda/ccudart.pyx" | |
| ] | |
| }, | |
| "module_name": "cuda.ccudart" | |
| } | |
| END: Cython Metadata */ | |
| /* InitLimitedAPI */ | |
| /* CModulePreamble */ | |
| /* For very preliminary testing purposes. Most variables are set the same as PyPy. | |
| The existence of this section does not imply that anything works or is even tested */ | |
| enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; | |
| /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 | |
| * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
| template<class T> void CYTHON_UNUSED_VAR( const T& ) { } | |
| typedef unsigned char uint8_t; | |
| typedef unsigned short uint16_t; | |
| typedef unsigned int uint32_t; | |
| typedef unsigned __int8 uint8_t; | |
| typedef unsigned __int16 uint16_t; | |
| typedef unsigned __int32 uint32_t; | |
| typedef unsigned long long __pyx_uintptr_t; | |
| typedef unsigned int __pyx_uintptr_t; | |
| typedef unsigned __int64 __pyx_uintptr_t; | |
| typedef unsigned __int32 __pyx_uintptr_t; | |
| typedef uintptr_t __pyx_uintptr_t; | |
| /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 | |
| * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
| template <typename T> | |
| struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; | |
| /* CppInitCode */ | |
| template<typename T> | |
| void __Pyx_call_destructor(T& x) { | |
| x.~T(); | |
| } | |
| template<typename T> | |
| class __Pyx_FakeReference { | |
| public: | |
| __Pyx_FakeReference() : ptr(NULL) { } | |
| __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { } | |
| T *operator->() { return ptr; } | |
| T *operator&() { return ptr; } | |
| operator T&() { return *ptr; } | |
| template<typename U> bool operator ==(const U& other) const { return *ptr == other; } | |
| template<typename U> bool operator !=(const U& other) const { return *ptr != other; } | |
| template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; } | |
| template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; } | |
| private: | |
| T *ptr; | |
| }; | |
| /* PythonCompatibility */ | |
| static int CO_OPTIMIZED; | |
| static int CO_NEWLOCALS; | |
| static int CO_VARARGS; | |
| static int CO_VARKEYWORDS; | |
| static int CO_ASYNC_GENERATOR; | |
| static int CO_GENERATOR; | |
| static int CO_COROUTINE; | |
| static int __Pyx_init_co_variables(void); | |
| typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); | |
| typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, | |
| Py_ssize_t nargs, PyObject *kwnames); | |
| typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, | |
| size_t nargsf, PyObject *kwnames); | |
| static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { | |
| return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; | |
| } | |
| static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { | |
| return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
| return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
| } | |
| typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); | |
| static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) | |
| { | |
| void *result; | |
| result = PyModule_GetState(op); | |
| if (!result) | |
| Py_FatalError("Couldn't find the module state"); | |
| return result; | |
| } | |
| static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { | |
| PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); | |
| if (res == NULL) PyErr_Clear(); | |
| return res; | |
| } | |
| static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { | |
| return PyDict_GetItem(dict, name); | |
| PyDictEntry *ep; | |
| PyDictObject *mp = (PyDictObject*) dict; | |
| long hash = ((PyStringObject *) name)->ob_shash; | |
| assert(hash != -1); | |
| ep = (mp->ma_lookup)(mp, name, hash); | |
| if (ep == NULL) { | |
| return NULL; | |
| } | |
| return ep->me_value; | |
| } | |
| static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { | |
| *result = PyObject_GetItem(dict, key); | |
| if (*result == NULL) { | |
| if (PyErr_ExceptionMatches(PyExc_KeyError)) { | |
| PyErr_Clear(); | |
| return 0; | |
| } | |
| return -1; | |
| } | |
| return 1; | |
| } | |
| static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { | |
| *result = PyDict_GetItemWithError(dict, key); | |
| if (*result == NULL) { | |
| return PyErr_Occurred() ? -1 : 0; | |
| } | |
| Py_INCREF(*result); | |
| return 1; | |
| } | |
| static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { | |
| PyObject *module = PyImport_AddModule(name); | |
| Py_XINCREF(module); | |
| return module; | |
| } | |
| typedef enum { | |
| PYGEN_RETURN = 0, | |
| PYGEN_ERROR = -1, | |
| PYGEN_NEXT = 1, | |
| } __Pyx_PySendResult; | |
| typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); | |
| typedef struct { | |
| unaryfunc am_await; | |
| unaryfunc am_aiter; | |
| unaryfunc am_anext; | |
| __Pyx_pyiter_sendfunc am_send; | |
| } __Pyx_PyAsyncMethodsStruct; | |
| extern "C" | |
| PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); | |
| static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { | |
| int value; | |
| PyObject *py_value = PyObject_GetAttrString(inspect, name); | |
| if (!py_value) return 0; | |
| value = (int) PyLong_AsLong(py_value); | |
| Py_DECREF(py_value); | |
| *write_to = value; | |
| return value != -1 || !PyErr_Occurred(); | |
| } | |
| static int __Pyx_init_co_variables(void) { | |
| PyObject *inspect; | |
| int result; | |
| inspect = PyImport_ImportModule("inspect"); | |
| result = | |
| __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && | |
| __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && | |
| __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && | |
| __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && | |
| __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && | |
| __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && | |
| __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && | |
| 1; | |
| Py_DECREF(inspect); | |
| return result ? 0 : -1; | |
| } | |
| static int __Pyx_init_co_variables(void) { | |
| return 0; // It's a limited API-only feature | |
| } | |
| /* MathInitCode */ | |
| static CYTHON_INLINE float __PYX_NAN() { | |
| float value; | |
| memset(&value, 0xFF, sizeof(value)); | |
| return value; | |
| } | |
| /* Early includes */ | |
| static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { | |
| return (size_t) i < (size_t) limit; | |
| } | |
| static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); | |
| static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); | |
| static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
| static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); | |
| static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
| static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { | |
| return Py_NewRef(obj); | |
| Py_INCREF(obj); | |
| return obj; | |
| } | |
| static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { | |
| return Py_XNewRef(obj); | |
| Py_XINCREF(obj); | |
| return obj; | |
| } | |
| static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); | |
| static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); | |
| static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
| static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); | |
| static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); | |
| static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
| static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); | |
| static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); | |
| typedef Py_ssize_t __Pyx_compact_pylong; | |
| typedef size_t __Pyx_compact_upylong; | |
| typedef sdigit __Pyx_compact_pylong; | |
| typedef digit __Pyx_compact_upylong; | |
| static CYTHON_INLINE int __Pyx_PyLong_CompactAsLong(PyObject *x, long *return_value); | |
| /* Test for GCC > 2.95 */ | |
| /* PretendToInitialize */ | |
| template <typename T> | |
| static void __Pyx_pretend_to_initialize(T* ptr) { | |
| if ((std::is_trivially_default_constructible<T>::value)) | |
| *ptr = T(); | |
| (void)ptr; | |
| } | |
| static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } | |
| static PyObject *__pyx_m = NULL; | |
| static int __pyx_lineno; | |
| static int __pyx_clineno = 0; | |
| static const char * const __pyx_cfilenm = __FILE__; | |
| static const char *__pyx_filename; | |
| /* #### Code section: filename_table ### */ | |
| static const char* const __pyx_f[] = { | |
| "cuda/ccudart.pyx", | |
| }; | |
| /* #### Code section: utility_code_proto_before_types ### */ | |
| /* CriticalSections.proto */ | |
| /* Atomics.proto */ | |
| static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { | |
| __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); | |
| int result = old == *expected; | |
| *expected = old; | |
| return result; | |
| } | |
| static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { | |
| __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); | |
| int result = old == *expected; | |
| *expected = old; | |
| return result; | |
| } | |
| /* #### Code section: numeric_typedefs ### */ | |
| /* "cuda/bindings/cyruntime.pxd":10 | |
| * include "cyruntime_types.pxi" | |
| * | |
| * ctypedef unsigned int GLenum # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef unsigned int GLuint | |
| */ | |
| typedef unsigned int __pyx_t_4cuda_8bindings_9cyruntime_GLenum; | |
| /* "cuda/bindings/cyruntime.pxd":12 | |
| * ctypedef unsigned int GLenum | |
| * | |
| * ctypedef unsigned int GLuint # <<<<<<<<<<<<<< | |
| * | |
| * cdef extern from "": | |
| */ | |
| typedef unsigned int __pyx_t_4cuda_8bindings_9cyruntime_GLuint; | |
| /* "cuda/bindings/cyruntime.pxd":24 | |
| * ctypedef void* EGLStreamKHR | |
| * | |
| * ctypedef unsigned int EGLint # <<<<<<<<<<<<<< | |
| * | |
| * cdef extern from "": | |
| */ | |
| typedef unsigned int __pyx_t_4cuda_8bindings_9cyruntime_EGLint; | |
| /* "cuda/bindings/cyruntime.pxd":31 | |
| * ctypedef void* EGLSyncKHR | |
| * | |
| * ctypedef uint32_t VdpDevice # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef unsigned long long VdpGetProcAddress | |
| */ | |
| typedef uint32_t __pyx_t_4cuda_8bindings_9cyruntime_VdpDevice; | |
| /* "cuda/bindings/cyruntime.pxd":33 | |
| * ctypedef uint32_t VdpDevice | |
| * | |
| * ctypedef unsigned long long VdpGetProcAddress # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef uint32_t VdpVideoSurface | |
| */ | |
| typedef unsigned PY_LONG_LONG __pyx_t_4cuda_8bindings_9cyruntime_VdpGetProcAddress; | |
| /* "cuda/bindings/cyruntime.pxd":35 | |
| * ctypedef unsigned long long VdpGetProcAddress | |
| * | |
| * ctypedef uint32_t VdpVideoSurface # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef uint32_t VdpOutputSurface | |
| */ | |
| typedef uint32_t __pyx_t_4cuda_8bindings_9cyruntime_VdpVideoSurface; | |
| /* "cuda/bindings/cyruntime.pxd":37 | |
| * ctypedef uint32_t VdpVideoSurface | |
| * | |
| * ctypedef uint32_t VdpOutputSurface # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum cudaEglFrameType_enum: | |
| */ | |
| typedef uint32_t __pyx_t_4cuda_8bindings_9cyruntime_VdpOutputSurface; | |
| /* #### Code section: complex_type_declarations ### */ | |
| /* #### Code section: type_declarations ### */ | |
| /*--- Type declarations ---*/ | |
| struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglPlaneDesc_st; | |
| union __pyx_t_4cuda_8bindings_9cyruntime_anon_union11; | |
| struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame_st; | |
| /* "cuda/bindings/cyruntime.pxd":39 | |
| * ctypedef uint32_t VdpOutputSurface | |
| * | |
| * cdef enum cudaEglFrameType_enum: # <<<<<<<<<<<<<< | |
| * cudaEglFrameTypeArray = 0 | |
| * cudaEglFrameTypePitch = 1 | |
| */ | |
| enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrameType_enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglFrameTypeArray = 0, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglFrameTypePitch = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":45 | |
| * ctypedef cudaEglFrameType_enum cudaEglFrameType | |
| * | |
| * cdef enum cudaEglResourceLocationFlags_enum: # <<<<<<<<<<<<<< | |
| * cudaEglResourceLocationSysmem = 0 | |
| * cudaEglResourceLocationVidmem = 1 | |
| */ | |
| enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglResourceLocationFlags_enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglResourceLocationSysmem = 0, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglResourceLocationVidmem = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":51 | |
| * ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags | |
| * | |
| * cdef enum cudaEglColorFormat_enum: # <<<<<<<<<<<<<< | |
| * cudaEglColorFormatYUV420Planar = 0 | |
| * cudaEglColorFormatYUV420SemiPlanar = 1 | |
| */ | |
| enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglColorFormat_enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420Planar = 0, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420SemiPlanar = 1, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV422Planar = 2, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV422SemiPlanar = 3, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatARGB = 6, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatRGBA = 7, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatL = 8, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatR = 9, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV444Planar = 10, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV444SemiPlanar = 11, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUYV422 = 12, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatUYVY422 = 13, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatABGR = 14, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBGRA = 15, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatA = 16, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatRG = 17, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatAYUV = 18, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU444SemiPlanar = 19, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU422SemiPlanar = 20, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420SemiPlanar = 21, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_444SemiPlanar = 22, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_420SemiPlanar = 23, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_444SemiPlanar = 24, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_420SemiPlanar = 25, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatVYUY_ER = 26, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatUYVY_ER = 27, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUYV_ER = 28, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVYU_ER = 29, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUVA_ER = 31, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatAYUV_ER = 32, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV444Planar_ER = 33, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV422Planar_ER = 34, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420Planar_ER = 35, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV444SemiPlanar_ER = 36, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV422SemiPlanar_ER = 37, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420SemiPlanar_ER = 38, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU444Planar_ER = 39, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU422Planar_ER = 40, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420Planar_ER = 41, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU444SemiPlanar_ER = 42, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU422SemiPlanar_ER = 43, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420SemiPlanar_ER = 44, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerRGGB = 45, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerBGGR = 46, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerGRBG = 47, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerGBRG = 48, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer10RGGB = 49, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer10BGGR = 50, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer10GRBG = 51, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer10GBRG = 52, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12RGGB = 53, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12BGGR = 54, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12GRBG = 55, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12GBRG = 56, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer14RGGB = 57, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer14BGGR = 58, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer14GRBG = 59, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer14GBRG = 60, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer20RGGB = 61, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer20BGGR = 62, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer20GRBG = 63, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer20GBRG = 64, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU444Planar = 65, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU422Planar = 66, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420Planar = 67, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerIspRGGB = 68, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerIspBGGR = 69, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerIspGRBG = 70, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerIspGBRG = 71, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerBCCR = 72, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerRCCB = 73, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerCRBC = 74, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayerCBRC = 75, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer10CCCC = 76, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12BCCR = 77, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12RCCB = 78, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12CRBC = 79, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12CBRC = 80, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatBayer12CCCC = 81, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY = 82, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420SemiPlanar_2020 = 83, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420SemiPlanar_2020 = 84, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420Planar_2020 = 85, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420Planar_2020 = 86, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420SemiPlanar_709 = 87, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420SemiPlanar_709 = 88, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUV420Planar_709 = 89, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVU420Planar_709 = 90, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_420SemiPlanar_709 = 91, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_420SemiPlanar_2020 = 92, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_422SemiPlanar_2020 = 93, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_422SemiPlanar = 94, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_422SemiPlanar_709 = 95, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY_ER = 96, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY_709_ER = 97, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10_ER = 98, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10_709_ER = 99, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12_ER = 0x64, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12_709_ER = 0x65, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYUVA = 0x66, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatYVYU = 0x68, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatVYUY = 0x69, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_420SemiPlanar_ER = 0x6A, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER = 0x6B, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_444SemiPlanar_ER = 0x6C, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER = 0x6D, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_420SemiPlanar_ER = 0x6E, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER = 0x6F, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_444SemiPlanar_ER = 0x70, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = 0x71, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatUYVY709 = 0x72, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatUYVY709_ER = 0x73, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEglColorFormatUYVY2020 = 0x74 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":197 | |
| * ctypedef CUeglStreamConnection_st* cudaEglStreamConnection | |
| * | |
| * cdef enum cudaGLDeviceList: # <<<<<<<<<<<<<< | |
| * cudaGLDeviceListAll = 1 | |
| * cudaGLDeviceListCurrentFrame = 2 | |
| */ | |
| enum __pyx_t_4cuda_8bindings_9cyruntime_cudaGLDeviceList { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLDeviceListAll = 1, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLDeviceListCurrentFrame = 2, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLDeviceListNextFrame = 3 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":202 | |
| * cudaGLDeviceListNextFrame = 3 | |
| * | |
| * cdef enum cudaGLMapFlags: # <<<<<<<<<<<<<< | |
| * cudaGLMapFlagsNone = 0 | |
| * cudaGLMapFlagsReadOnly = 1 | |
| */ | |
| enum __pyx_t_4cuda_8bindings_9cyruntime_cudaGLMapFlags { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLMapFlagsNone = 0, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLMapFlagsReadOnly = 1, | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGLMapFlagsWriteDiscard = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":831 | |
| * cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil | |
| * | |
| * cdef enum: cudaHostAllocDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostAllocPortable = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostAllocDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":833 | |
| * cdef enum: cudaHostAllocDefault = 0 | |
| * | |
| * cdef enum: cudaHostAllocPortable = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostAllocMapped = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostAllocPortable = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":835 | |
| * cdef enum: cudaHostAllocPortable = 1 | |
| * | |
| * cdef enum: cudaHostAllocMapped = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostAllocWriteCombined = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostAllocMapped = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":837 | |
| * cdef enum: cudaHostAllocMapped = 2 | |
| * | |
| * cdef enum: cudaHostAllocWriteCombined = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostRegisterDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostAllocWriteCombined = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":839 | |
| * cdef enum: cudaHostAllocWriteCombined = 4 | |
| * | |
| * cdef enum: cudaHostRegisterDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostRegisterPortable = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostRegisterDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":841 | |
| * cdef enum: cudaHostRegisterDefault = 0 | |
| * | |
| * cdef enum: cudaHostRegisterPortable = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostRegisterMapped = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostRegisterPortable = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":843 | |
| * cdef enum: cudaHostRegisterPortable = 1 | |
| * | |
| * cdef enum: cudaHostRegisterMapped = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostRegisterIoMemory = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostRegisterMapped = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":845 | |
| * cdef enum: cudaHostRegisterMapped = 2 | |
| * | |
| * cdef enum: cudaHostRegisterIoMemory = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaHostRegisterReadOnly = 8 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostRegisterIoMemory = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":847 | |
| * cdef enum: cudaHostRegisterIoMemory = 4 | |
| * | |
| * cdef enum: cudaHostRegisterReadOnly = 8 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaPeerAccessDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaHostRegisterReadOnly = 8 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":849 | |
| * cdef enum: cudaHostRegisterReadOnly = 8 | |
| * | |
| * cdef enum: cudaPeerAccessDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaPeerAccessDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":851 | |
| * cdef enum: cudaPeerAccessDefault = 0 | |
| * | |
| * cdef enum: cudaStreamDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamNonBlocking = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":853 | |
| * cdef enum: cudaStreamDefault = 0 | |
| * | |
| * cdef enum: cudaStreamNonBlocking = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamLegacy = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamNonBlocking = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":855 | |
| * cdef enum: cudaStreamNonBlocking = 1 | |
| * | |
| * cdef enum: cudaStreamLegacy = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamPerThread = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamLegacy = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":857 | |
| * cdef enum: cudaStreamLegacy = 1 | |
| * | |
| * cdef enum: cudaStreamPerThread = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamPerThread = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":859 | |
| * cdef enum: cudaStreamPerThread = 2 | |
| * | |
| * cdef enum: cudaEventDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventBlockingSync = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":861 | |
| * cdef enum: cudaEventDefault = 0 | |
| * | |
| * cdef enum: cudaEventBlockingSync = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventDisableTiming = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventBlockingSync = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":863 | |
| * cdef enum: cudaEventBlockingSync = 1 | |
| * | |
| * cdef enum: cudaEventDisableTiming = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventInterprocess = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventDisableTiming = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":865 | |
| * cdef enum: cudaEventDisableTiming = 2 | |
| * | |
| * cdef enum: cudaEventInterprocess = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventRecordDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventInterprocess = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":867 | |
| * cdef enum: cudaEventInterprocess = 4 | |
| * | |
| * cdef enum: cudaEventRecordDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventRecordExternal = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventRecordDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":869 | |
| * cdef enum: cudaEventRecordDefault = 0 | |
| * | |
| * cdef enum: cudaEventRecordExternal = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventWaitDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventRecordExternal = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":871 | |
| * cdef enum: cudaEventRecordExternal = 1 | |
| * | |
| * cdef enum: cudaEventWaitDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaEventWaitExternal = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventWaitDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":873 | |
| * cdef enum: cudaEventWaitDefault = 0 | |
| * | |
| * cdef enum: cudaEventWaitExternal = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceScheduleAuto = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaEventWaitExternal = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":875 | |
| * cdef enum: cudaEventWaitExternal = 1 | |
| * | |
| * cdef enum: cudaDeviceScheduleAuto = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceScheduleSpin = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceScheduleAuto = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":877 | |
| * cdef enum: cudaDeviceScheduleAuto = 0 | |
| * | |
| * cdef enum: cudaDeviceScheduleSpin = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceScheduleYield = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceScheduleSpin = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":879 | |
| * cdef enum: cudaDeviceScheduleSpin = 1 | |
| * | |
| * cdef enum: cudaDeviceScheduleYield = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceScheduleBlockingSync = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceScheduleYield = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":881 | |
| * cdef enum: cudaDeviceScheduleYield = 2 | |
| * | |
| * cdef enum: cudaDeviceScheduleBlockingSync = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceBlockingSync = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceScheduleBlockingSync = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":883 | |
| * cdef enum: cudaDeviceScheduleBlockingSync = 4 | |
| * | |
| * cdef enum: cudaDeviceBlockingSync = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceScheduleMask = 7 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceBlockingSync = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":885 | |
| * cdef enum: cudaDeviceBlockingSync = 4 | |
| * | |
| * cdef enum: cudaDeviceScheduleMask = 7 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceMapHost = 8 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceScheduleMask = 7 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":887 | |
| * cdef enum: cudaDeviceScheduleMask = 7 | |
| * | |
| * cdef enum: cudaDeviceMapHost = 8 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceLmemResizeToMax = 16 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceMapHost = 8 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":889 | |
| * cdef enum: cudaDeviceMapHost = 8 | |
| * | |
| * cdef enum: cudaDeviceLmemResizeToMax = 16 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceSyncMemops = 128 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceLmemResizeToMax = 16 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":891 | |
| * cdef enum: cudaDeviceLmemResizeToMax = 16 | |
| * | |
| * cdef enum: cudaDeviceSyncMemops = 128 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaDeviceMask = 255 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceSyncMemops = 0x80 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":893 | |
| * cdef enum: cudaDeviceSyncMemops = 128 | |
| * | |
| * cdef enum: cudaDeviceMask = 255 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaDeviceMask = 0xFF | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":895 | |
| * cdef enum: cudaDeviceMask = 255 | |
| * | |
| * cdef enum: cudaArrayDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayLayered = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":897 | |
| * cdef enum: cudaArrayDefault = 0 | |
| * | |
| * cdef enum: cudaArrayLayered = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArraySurfaceLoadStore = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayLayered = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":899 | |
| * cdef enum: cudaArrayLayered = 1 | |
| * | |
| * cdef enum: cudaArraySurfaceLoadStore = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayCubemap = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArraySurfaceLoadStore = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":901 | |
| * cdef enum: cudaArraySurfaceLoadStore = 2 | |
| * | |
| * cdef enum: cudaArrayCubemap = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayTextureGather = 8 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayCubemap = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":903 | |
| * cdef enum: cudaArrayCubemap = 4 | |
| * | |
| * cdef enum: cudaArrayTextureGather = 8 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayColorAttachment = 32 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayTextureGather = 8 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":905 | |
| * cdef enum: cudaArrayTextureGather = 8 | |
| * | |
| * cdef enum: cudaArrayColorAttachment = 32 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArraySparse = 64 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayColorAttachment = 32 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":907 | |
| * cdef enum: cudaArrayColorAttachment = 32 | |
| * | |
| * cdef enum: cudaArraySparse = 64 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArrayDeferredMapping = 128 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArraySparse = 64 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":909 | |
| * cdef enum: cudaArraySparse = 64 | |
| * | |
| * cdef enum: cudaArrayDeferredMapping = 128 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArrayDeferredMapping = 0x80 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":911 | |
| * cdef enum: cudaArrayDeferredMapping = 128 | |
| * | |
| * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaMemAttachGlobal = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaIpcMemLazyEnablePeerAccess = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":913 | |
| * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1 | |
| * | |
| * cdef enum: cudaMemAttachGlobal = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaMemAttachHost = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaMemAttachGlobal = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":915 | |
| * cdef enum: cudaMemAttachGlobal = 1 | |
| * | |
| * cdef enum: cudaMemAttachHost = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaMemAttachSingle = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaMemAttachHost = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":917 | |
| * cdef enum: cudaMemAttachHost = 2 | |
| * | |
| * cdef enum: cudaMemAttachSingle = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaOccupancyDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaMemAttachSingle = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":919 | |
| * cdef enum: cudaMemAttachSingle = 4 | |
| * | |
| * cdef enum: cudaOccupancyDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaOccupancyDisableCachingOverride = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaOccupancyDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":921 | |
| * cdef enum: cudaOccupancyDefault = 0 | |
| * | |
| * cdef enum: cudaOccupancyDisableCachingOverride = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaCpuDeviceId = -1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaOccupancyDisableCachingOverride = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":923 | |
| * cdef enum: cudaOccupancyDisableCachingOverride = 1 | |
| * | |
| * cdef enum: cudaCpuDeviceId = -1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaInvalidDeviceId = -2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaCpuDeviceId = -1L | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":925 | |
| * cdef enum: cudaCpuDeviceId = -1 | |
| * | |
| * cdef enum: cudaInvalidDeviceId = -2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaInitDeviceFlagsAreValid = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaInvalidDeviceId = -2L | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":927 | |
| * cdef enum: cudaInvalidDeviceId = -2 | |
| * | |
| * cdef enum: cudaInitDeviceFlagsAreValid = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaInitDeviceFlagsAreValid = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":929 | |
| * cdef enum: cudaInitDeviceFlagsAreValid = 1 | |
| * | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaCooperativeLaunchMultiDeviceNoPreSync = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":931 | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1 | |
| * | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaCooperativeLaunchMultiDeviceNoPostSync = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":933 | |
| * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2 | |
| * | |
| * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaArraySparsePropertiesSingleMipTail = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":935 | |
| * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 | |
| * | |
| * cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: CUDA_IPC_HANDLE_SIZE = 64 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaMemPoolCreateUsageHwDecompress = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":937 | |
| * cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 | |
| * | |
| * cdef enum: CUDA_IPC_HANDLE_SIZE = 64 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaExternalMemoryDedicated = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_CUDA_IPC_HANDLE_SIZE = 64 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":939 | |
| * cdef enum: CUDA_IPC_HANDLE_SIZE = 64 | |
| * | |
| * cdef enum: cudaExternalMemoryDedicated = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaExternalMemoryDedicated = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":941 | |
| * cdef enum: cudaExternalMemoryDedicated = 1 | |
| * | |
| * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":943 | |
| * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 | |
| * | |
| * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaNvSciSyncAttrSignal = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":945 | |
| * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 | |
| * | |
| * cdef enum: cudaNvSciSyncAttrSignal = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaNvSciSyncAttrWait = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaNvSciSyncAttrSignal = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":947 | |
| * cdef enum: cudaNvSciSyncAttrSignal = 1 | |
| * | |
| * cdef enum: cudaNvSciSyncAttrWait = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaGraphKernelNodePortDefault = 0 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaNvSciSyncAttrWait = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":949 | |
| * cdef enum: cudaNvSciSyncAttrWait = 2 | |
| * | |
| * cdef enum: cudaGraphKernelNodePortDefault = 0 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaGraphKernelNodePortProgrammatic = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGraphKernelNodePortDefault = 0 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":951 | |
| * cdef enum: cudaGraphKernelNodePortDefault = 0 | |
| * | |
| * cdef enum: cudaGraphKernelNodePortProgrammatic = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGraphKernelNodePortProgrammatic = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":953 | |
| * cdef enum: cudaGraphKernelNodePortProgrammatic = 1 | |
| * | |
| * cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaGraphKernelNodePortLaunchCompletion = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":955 | |
| * cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2 | |
| * | |
| * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamAttributeAccessPolicyWindow = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":957 | |
| * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1 | |
| * | |
| * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamAttributeSynchronizationPolicy = 3 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":959 | |
| * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3 | |
| * | |
| * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamAttributeMemSyncDomain = 10 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamAttributeMemSyncDomainMap = 9 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":961 | |
| * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9 | |
| * | |
| * cdef enum: cudaStreamAttributeMemSyncDomain = 10 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaStreamAttributePriority = 8 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamAttributeMemSyncDomain = 10 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":963 | |
| * cdef enum: cudaStreamAttributeMemSyncDomain = 10 | |
| * | |
| * cdef enum: cudaStreamAttributePriority = 8 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaStreamAttributePriority = 8 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":965 | |
| * cdef enum: cudaStreamAttributePriority = 8 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeCooperative = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeAccessPolicyWindow = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":967 | |
| * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeCooperative = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributePriority = 8 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeCooperative = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":969 | |
| * cdef enum: cudaKernelNodeAttributeCooperative = 2 | |
| * | |
| * cdef enum: cudaKernelNodeAttributePriority = 8 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeClusterDimension = 4 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributePriority = 8 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":971 | |
| * cdef enum: cudaKernelNodeAttributePriority = 8 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeClusterDimension = 4 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeClusterDimension = 4 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":973 | |
| * cdef enum: cudaKernelNodeAttributeClusterDimension = 4 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":975 | |
| * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeMemSyncDomainMap = 9 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":977 | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeMemSyncDomain = 10 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":979 | |
| * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10 | |
| * | |
| * cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":981 | |
| * cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 | |
| * | |
| * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceType1D = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":983 | |
| * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 | |
| * | |
| * cdef enum: cudaSurfaceType1D = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceType2D = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceType1D = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":985 | |
| * cdef enum: cudaSurfaceType1D = 1 | |
| * | |
| * cdef enum: cudaSurfaceType2D = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceType3D = 3 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceType2D = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":987 | |
| * cdef enum: cudaSurfaceType2D = 2 | |
| * | |
| * cdef enum: cudaSurfaceType3D = 3 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceTypeCubemap = 12 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceType3D = 3 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":989 | |
| * cdef enum: cudaSurfaceType3D = 3 | |
| * | |
| * cdef enum: cudaSurfaceTypeCubemap = 12 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceType1DLayered = 241 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceTypeCubemap = 12 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":991 | |
| * cdef enum: cudaSurfaceTypeCubemap = 12 | |
| * | |
| * cdef enum: cudaSurfaceType1DLayered = 241 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceType2DLayered = 242 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceType1DLayered = 0xF1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":993 | |
| * cdef enum: cudaSurfaceType1DLayered = 241 | |
| * | |
| * cdef enum: cudaSurfaceType2DLayered = 242 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaSurfaceTypeCubemapLayered = 252 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceType2DLayered = 0xF2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":995 | |
| * cdef enum: cudaSurfaceType2DLayered = 242 | |
| * | |
| * cdef enum: cudaSurfaceTypeCubemapLayered = 252 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureType1D = 1 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaSurfaceTypeCubemapLayered = 0xFC | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":997 | |
| * cdef enum: cudaSurfaceTypeCubemapLayered = 252 | |
| * | |
| * cdef enum: cudaTextureType1D = 1 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureType2D = 2 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureType1D = 1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":999 | |
| * cdef enum: cudaTextureType1D = 1 | |
| * | |
| * cdef enum: cudaTextureType2D = 2 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureType3D = 3 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureType2D = 2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1001 | |
| * cdef enum: cudaTextureType2D = 2 | |
| * | |
| * cdef enum: cudaTextureType3D = 3 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureTypeCubemap = 12 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureType3D = 3 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1003 | |
| * cdef enum: cudaTextureType3D = 3 | |
| * | |
| * cdef enum: cudaTextureTypeCubemap = 12 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureType1DLayered = 241 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureTypeCubemap = 12 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1005 | |
| * cdef enum: cudaTextureTypeCubemap = 12 | |
| * | |
| * cdef enum: cudaTextureType1DLayered = 241 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureType2DLayered = 242 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureType1DLayered = 0xF1 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1007 | |
| * cdef enum: cudaTextureType1DLayered = 241 | |
| * | |
| * cdef enum: cudaTextureType2DLayered = 242 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: cudaTextureTypeCubemapLayered = 252 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureType2DLayered = 0xF2 | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1009 | |
| * cdef enum: cudaTextureType2DLayered = 242 | |
| * | |
| * cdef enum: cudaTextureTypeCubemapLayered = 252 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: CUDART_VERSION = 12090 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_cudaTextureTypeCubemapLayered = 0xFC | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1011 | |
| * cdef enum: cudaTextureTypeCubemapLayered = 252 | |
| * | |
| * cdef enum: CUDART_VERSION = 12090 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: __CUDART_API_VERSION = 12090 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_CUDART_VERSION = 0x2F3A | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1013 | |
| * cdef enum: CUDART_VERSION = 12090 | |
| * | |
| * cdef enum: __CUDART_API_VERSION = 12090 # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum: CUDA_EGL_MAX_PLANES = 3 | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime___CUDART_API_VERSION = 0x2F3A | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":1015 | |
| * cdef enum: __CUDART_API_VERSION = 12090 | |
| * | |
| * cdef enum: CUDA_EGL_MAX_PLANES = 3 # <<<<<<<<<<<<<< | |
| */ | |
| enum { | |
| __pyx_e_4cuda_8bindings_9cyruntime_CUDA_EGL_MAX_PLANES = 3 | |
| }; | |
| /* "cuda/bindings/cyruntime_types.pxi":1553 | |
| * cudaRoundMinInf = 3 | |
| * | |
| * ctypedef cudaLaunchAttributeID cudaStreamAttrID # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID | |
| */ | |
| typedef enum cudaLaunchAttributeID __pyx_t_4cuda_8bindings_9cyruntime_cudaStreamAttrID; | |
| /* "cuda/bindings/cyruntime_types.pxi":1555 | |
| * ctypedef cudaLaunchAttributeID cudaStreamAttrID | |
| * | |
| * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue | |
| */ | |
| typedef enum cudaLaunchAttributeID __pyx_t_4cuda_8bindings_9cyruntime_cudaKernelNodeAttrID; | |
| /* "cuda/bindings/cyruntime_types.pxi":1557 | |
| * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID | |
| * | |
| * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue | |
| */ | |
| typedef union cudaLaunchAttributeValue __pyx_t_4cuda_8bindings_9cyruntime_cudaStreamAttrValue; | |
| /* "cuda/bindings/cyruntime_types.pxi":1559 | |
| * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue | |
| * | |
| * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue # <<<<<<<<<<<<<< | |
| */ | |
| typedef union cudaLaunchAttributeValue __pyx_t_4cuda_8bindings_9cyruntime_cudaKernelNodeAttrValue; | |
| /* "cuda/bindings/cyruntime.pxd":17 | |
| * cdef struct void: | |
| * pass | |
| * ctypedef void* EGLImageKHR # <<<<<<<<<<<<<< | |
| * | |
| * cdef extern from "": | |
| */ | |
| typedef void *__pyx_t_4cuda_8bindings_9cyruntime_EGLImageKHR; | |
| /* "cuda/bindings/cyruntime.pxd":22 | |
| * cdef struct void: | |
| * pass | |
| * ctypedef void* EGLStreamKHR # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef unsigned int EGLint | |
| */ | |
| typedef void *__pyx_t_4cuda_8bindings_9cyruntime_EGLStreamKHR; | |
| /* "cuda/bindings/cyruntime.pxd":29 | |
| * cdef struct void: | |
| * pass | |
| * ctypedef void* EGLSyncKHR # <<<<<<<<<<<<<< | |
| * | |
| * ctypedef uint32_t VdpDevice | |
| */ | |
| typedef void *__pyx_t_4cuda_8bindings_9cyruntime_EGLSyncKHR; | |
| /* "cuda/bindings/cyruntime.pxd":43 | |
| * cudaEglFrameTypePitch = 1 | |
| * | |
| * ctypedef cudaEglFrameType_enum cudaEglFrameType # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum cudaEglResourceLocationFlags_enum: | |
| */ | |
| typedef enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrameType_enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrameType; | |
| /* "cuda/bindings/cyruntime.pxd":49 | |
| * cudaEglResourceLocationVidmem = 1 | |
| * | |
| * ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum cudaEglColorFormat_enum: | |
| */ | |
| typedef enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglResourceLocationFlags_enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglResourceLocationFlags; | |
| /* "cuda/bindings/cyruntime.pxd":166 | |
| * cudaEglColorFormatUYVY2020 = 116 | |
| * | |
| * ctypedef cudaEglColorFormat_enum cudaEglColorFormat # <<<<<<<<<<<<<< | |
| * | |
| * cdef struct cudaEglPlaneDesc_st: | |
| */ | |
| typedef enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglColorFormat_enum __pyx_t_4cuda_8bindings_9cyruntime_cudaEglColorFormat; | |
| /* "cuda/bindings/cyruntime.pxd":168 | |
| * ctypedef cudaEglColorFormat_enum cudaEglColorFormat | |
| * | |
| * cdef struct cudaEglPlaneDesc_st: # <<<<<<<<<<<<<< | |
| * unsigned int width | |
| * unsigned int height | |
| */ | |
| struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglPlaneDesc_st { | |
| unsigned int width; | |
| unsigned int height; | |
| unsigned int depth; | |
| unsigned int pitch; | |
| unsigned int numChannels; | |
| struct cudaChannelFormatDesc channelDesc; | |
| unsigned int reserved[4]; | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":177 | |
| * unsigned int reserved[4] | |
| * | |
| * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc # <<<<<<<<<<<<<< | |
| * | |
| * cdef union anon_union11: | |
| */ | |
| typedef struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglPlaneDesc_st __pyx_t_4cuda_8bindings_9cyruntime_cudaEglPlaneDesc; | |
| /* "cuda/bindings/cyruntime.pxd":179 | |
| * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc | |
| * | |
| * cdef union anon_union11: # <<<<<<<<<<<<<< | |
| * cudaArray_t pArray[3] | |
| * cudaPitchedPtr pPitch[3] | |
| */ | |
| union __pyx_t_4cuda_8bindings_9cyruntime_anon_union11 { | |
| cudaArray_t pArray[3]; | |
| struct cudaPitchedPtr pPitch[3]; | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":183 | |
| * cudaPitchedPtr pPitch[3] | |
| * | |
| * cdef struct cudaEglFrame_st: # <<<<<<<<<<<<<< | |
| * anon_union11 frame | |
| * cudaEglPlaneDesc planeDesc[3] | |
| */ | |
| struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame_st { | |
| union __pyx_t_4cuda_8bindings_9cyruntime_anon_union11 frame; | |
| __pyx_t_4cuda_8bindings_9cyruntime_cudaEglPlaneDesc planeDesc[3]; | |
| unsigned int planeCount; | |
| __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrameType frameType; | |
| __pyx_t_4cuda_8bindings_9cyruntime_cudaEglColorFormat eglColorFormat; | |
| }; | |
| /* "cuda/bindings/cyruntime.pxd":190 | |
| * cudaEglColorFormat eglColorFormat | |
| * | |
| * ctypedef cudaEglFrame_st cudaEglFrame # <<<<<<<<<<<<<< | |
| * | |
| * cdef extern from "": | |
| */ | |
| typedef struct __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame_st __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame; | |
| /* "cuda/bindings/cyruntime.pxd":195 | |
| * cdef struct CUeglStreamConnection_st: | |
| * pass | |
| * ctypedef CUeglStreamConnection_st* cudaEglStreamConnection # <<<<<<<<<<<<<< | |
| * | |
| * cdef enum cudaGLDeviceList: | |
| */ | |
| typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_8bindings_9cyruntime_cudaEglStreamConnection; | |
| /* #### Code section: utility_code_proto ### */ | |
| /* --- Runtime support code (head) --- */ | |
| /* Refnanny.proto */ | |
| typedef struct { | |
| void (*INCREF)(void*, PyObject*, Py_ssize_t); | |
| void (*DECREF)(void*, PyObject*, Py_ssize_t); | |
| void (*GOTREF)(void*, PyObject*, Py_ssize_t); | |
| void (*GIVEREF)(void*, PyObject*, Py_ssize_t); | |
| void* (*SetupContext)(const char*, Py_ssize_t, const char*); | |
| void (*FinishContext)(void**); | |
| } __Pyx_RefNannyAPIStruct; | |
| static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
| static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); | |
| /* ListPack.proto */ | |
| static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); | |
| /* PyObjectGetAttrStr.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); | |
| /* IncludeStringH.proto */ | |
| /* Import.proto */ | |
| static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); | |
| /* ImportFrom.proto */ | |
| static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); | |
| /* PyErrExceptionMatches.proto */ | |
| static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); | |
| /* PyThreadStateGet.proto */ | |
| /* PyErrFetchRestore.proto */ | |
| static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
| static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
| /* PyObjectGetAttrStrNoError.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); | |
| /* GetBuiltinName.proto */ | |
| static PyObject *__Pyx_GetBuiltinName(PyObject *name); | |
| /* PyDictVersioning.proto */ | |
| static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); | |
| static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); | |
| static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); | |
| /* GetModuleGlobalName.proto */ | |
| static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); | |
| static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); | |
| /* PyObjectDelAttr.proto */ | |
| /* PyObjectSetAttrStr.proto */ | |
| static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); | |
| /* CLineInTraceback.proto */ | |
| static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); | |
| /* CodeObjectCache.proto */ | |
| typedef PyObject __Pyx_CachedCodeObjectType; | |
| typedef PyCodeObject __Pyx_CachedCodeObjectType; | |
| typedef struct { | |
| __Pyx_CachedCodeObjectType* code_object; | |
| int code_line; | |
| } __Pyx_CodeObjectCacheEntry; | |
| struct __Pyx_CodeObjectCache { | |
| int count; | |
| int max_count; | |
| __Pyx_CodeObjectCacheEntry* entries; | |
| __pyx_atomic_int_type accessor_count; | |
| }; | |
| static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
| static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); | |
| static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); | |
| /* AddTraceback.proto */ | |
| static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
| int py_line, const char *filename); | |
| /* FormatTypeName.proto */ | |
| typedef PyObject *__Pyx_TypeName; | |
| static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); | |
| typedef const char *__Pyx_TypeName; | |
| /* GCCDiagnostics.proto */ | |
| /* PyFunctionFastCall.proto */ | |
| static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); | |
| static size_t __pyx_pyframe_localsplus_offset = 0; | |
| /* PyObjectCall.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); | |
| /* PyObjectCallMethO.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); | |
| /* PyObjectFastCall.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); | |
| /* PyObjectVectorCallKwBuilder.proto */ | |
| CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); | |
| static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); | |
| static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); | |
| /* CIntToPy.proto */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); | |
| /* CIntFromPy.proto */ | |
| static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); | |
| /* CIntFromPy.proto */ | |
| static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); | |
| /* FastTypeChecks.proto */ | |
| static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); | |
| static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); | |
| static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); | |
| static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); | |
| static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { | |
| return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); | |
| } | |
| /* GetRuntimeVersion.proto */ | |
| static unsigned long __Pyx_get_runtime_version(void); | |
| /* CheckBinaryVersion.proto */ | |
| static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); | |
| /* MultiPhaseInitModuleState.proto */ | |
| static PyObject *__Pyx_State_FindModule(void*); | |
| static int __Pyx_State_AddModule(PyObject* module, void*); | |
| static int __Pyx_State_RemoveModule(void*); | |
| /* #### Code section: module_declarations ### */ | |
| /* CythonABIVersion.proto */ | |
| /* Module declarations from "libc.stdint" */ | |
| /* Module declarations from "cuda.bindings.cyruntime" */ | |
| /* Module declarations from "cuda.ccudart" */ | |
| /* #### Code section: typeinfo ### */ | |
| /* #### Code section: before_global_var ### */ | |
| extern int __pyx_module_is_main_cuda__ccudart; | |
| int __pyx_module_is_main_cuda__ccudart = 0; | |
| /* Implementation of "cuda.ccudart" */ | |
| /* #### Code section: global_var ### */ | |
| /* #### Code section: string_decls ### */ | |
| static const char __pyx_k_[] = "."; | |
| static const char __pyx_k__2[] = "?"; | |
| static const char __pyx_k_main[] = "__main__"; | |
| static const char __pyx_k_name[] = "__name__"; | |
| static const char __pyx_k_test[] = "__test__"; | |
| static const char __pyx_k_module[] = "__module__"; | |
| static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; | |
| static const char __pyx_k_qualname[] = "__qualname__"; | |
| static const char __pyx_k_cyruntime[] = "cyruntime"; | |
| static const char __pyx_k_cuda_bindings[] = "cuda.bindings"; | |
| static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; | |
| /* #### Code section: decls ### */ | |
| /* #### Code section: late_includes ### */ | |
| /* #### Code section: module_state ### */ | |
| /* SmallCodeConfig */ | |
| typedef struct { | |
| PyObject *__pyx_d; | |
| PyObject *__pyx_b; | |
| PyObject *__pyx_cython_runtime; | |
| PyObject *__pyx_empty_tuple; | |
| PyObject *__pyx_empty_bytes; | |
| PyObject *__pyx_empty_unicode; | |
| PyTypeObject *__pyx_CyFunctionType; | |
| PyTypeObject *__pyx_FusedFunctionType; | |
| PyTypeObject *__pyx_GeneratorType; | |
| PyTypeObject *__pyx_IterableCoroutineType; | |
| PyTypeObject *__pyx_CoroutineAwaitType; | |
| PyTypeObject *__pyx_CoroutineType; | |
| PyObject *__pyx_string_tab[11]; | |
| /* #### Code section: module_state_contents ### */ | |
| /* CodeObjectCache.module_state_decls */ | |
| struct __Pyx_CodeObjectCache __pyx_code_cache; | |
| /* #### Code section: module_state_end ### */ | |
| } __pyx_mstatetype; | |
| namespace { | |
| extern struct PyModuleDef __pyx_moduledef; | |
| } /* anonymous namespace */ | |
| static struct PyModuleDef __pyx_moduledef; | |
| static __pyx_mstatetype __pyx_mstate_global_static = | |
| {}; | |
| {0}; | |
| static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; | |
| /* #### Code section: constant_name_defines ### */ | |
| /* #### Code section: module_state_clear ### */ | |
| static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { | |
| __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); | |
| if (!clear_module_state) return 0; | |
| Py_CLEAR(clear_module_state->__pyx_d); | |
| Py_CLEAR(clear_module_state->__pyx_b); | |
| Py_CLEAR(clear_module_state->__pyx_cython_runtime); | |
| Py_CLEAR(clear_module_state->__pyx_empty_tuple); | |
| Py_CLEAR(clear_module_state->__pyx_empty_bytes); | |
| Py_CLEAR(clear_module_state->__pyx_empty_unicode); | |
| Py_CLEAR(clear_module_state->__pyx_CyFunctionType); | |
| Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); | |
| __Pyx_State_RemoveModule(NULL); | |
| for (int i=0; i<11; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } | |
| return 0; | |
| } | |
| /* #### Code section: module_state_traverse ### */ | |
| static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { | |
| __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); | |
| if (!traverse_module_state) return 0; | |
| Py_VISIT(traverse_module_state->__pyx_d); | |
| Py_VISIT(traverse_module_state->__pyx_b); | |
| Py_VISIT(traverse_module_state->__pyx_cython_runtime); | |
| __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); | |
| __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); | |
| __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); | |
| Py_VISIT(traverse_module_state->__pyx_CyFunctionType); | |
| Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); | |
| for (int i=0; i<11; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } | |
| return 0; | |
| } | |
| /* #### Code section: module_code ### */ | |
| /* #### Code section: module_exttypes ### */ | |
| static PyMethodDef __pyx_methods[] = { | |
| {0, 0, 0, 0} | |
| }; | |
| /* #### Code section: initfunc_declarations ### */ | |
| static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ | |
| /* #### Code section: init_module ### */ | |
| static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); | |
| /*--- Global init code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); | |
| /*--- Variable export code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); | |
| /*--- Function export code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); | |
| /*--- Type init code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); | |
| /*--- Type import code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); | |
| /*--- Variable import code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); | |
| /*--- Function import code ---*/ | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ | |
| static int __pyx_pymod_exec_ccudart(PyObject* module); /*proto*/ | |
| static PyModuleDef_Slot __pyx_moduledef_slots[] = { | |
| {Py_mod_create, (void*)__pyx_pymod_create}, | |
| {Py_mod_exec, (void*)__pyx_pymod_exec_ccudart}, | |
| {Py_mod_gil, Py_MOD_GIL_NOT_USED}, | |
| {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, | |
| {0, NULL} | |
| }; | |
| namespace { | |
| struct PyModuleDef __pyx_moduledef = | |
| static struct PyModuleDef __pyx_moduledef = | |
| { | |
| PyModuleDef_HEAD_INIT, | |
| "ccudart", | |
| 0, /* m_doc */ | |
| sizeof(__pyx_mstatetype), /* m_size */ | |
| (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ | |
| __pyx_methods /* m_methods */, | |
| __pyx_moduledef_slots, /* m_slots */ | |
| NULL, /* m_reload */ | |
| __pyx_m_traverse, /* m_traverse */ | |
| __pyx_m_clear, /* m_clear */ | |
| NULL /* m_free */ | |
| NULL, /* m_traverse */ | |
| NULL, /* m_clear */ | |
| NULL /* m_free */ | |
| }; | |
| } /* anonymous namespace */ | |
| /* PyModInitFuncType */ | |
| __Pyx_PyMODINIT_FUNC PyInit_ccudart(void) CYTHON_SMALL_CODE; /*proto*/ | |
| __Pyx_PyMODINIT_FUNC PyInit_ccudart(void) | |
| { | |
| return PyModuleDef_Init(&__pyx_moduledef); | |
| } | |
| /* ModuleCreationPEP489 */ | |
| static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { | |
| { | |
| PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think | |
| if (!module) { | |
| PyErr_Clear(); // just try the 3.8-3.12 version | |
| module = PyImport_ImportModule("_xxsubinterpreters"); | |
| if (!module) goto bad; | |
| } | |
| PyObject *current = PyObject_CallMethod(module, "get_current", NULL); | |
| Py_DECREF(module); | |
| if (!current) goto bad; | |
| if (PyTuple_Check(current)) { | |
| PyObject *new_current = PySequence_GetItem(current, 0); | |
| Py_DECREF(current); | |
| current = new_current; | |
| if (!new_current) goto bad; | |
| } | |
| long long as_c_int = PyLong_AsLongLong(current); | |
| Py_DECREF(current); | |
| return as_c_int; | |
| } | |
| bad: | |
| PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); | |
| return -1; | |
| } | |
| static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { | |
| static PY_INT64_T main_interpreter_id = -1; | |
| PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); | |
| PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); | |
| PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); | |
| PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); | |
| if (unlikely(current_id == -1)) { | |
| return -1; | |
| } | |
| if (main_interpreter_id == -1) { | |
| main_interpreter_id = current_id; | |
| return 0; | |
| } else if (unlikely(main_interpreter_id != current_id)) { | |
| PyErr_SetString( | |
| PyExc_ImportError, | |
| "Interpreter change detected - this module can only be loaded into one interpreter per process."); | |
| return -1; | |
| } | |
| return 0; | |
| } | |
| static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) | |
| { | |
| PyObject *value = PyObject_GetAttrString(spec, from_name); | |
| int result = 0; | |
| if (likely(value)) { | |
| if (allow_none || value != Py_None) { | |
| result = PyDict_SetItemString(moddict, to_name, value); | |
| } | |
| Py_DECREF(value); | |
| } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
| PyErr_Clear(); | |
| } else { | |
| result = -1; | |
| } | |
| return result; | |
| } | |
| static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { | |
| PyObject *module = NULL, *moddict, *modname; | |
| CYTHON_UNUSED_VAR(def); | |
| if (__Pyx_check_single_interpreter()) | |
| return NULL; | |
| if (__pyx_m) | |
| return __Pyx_NewRef(__pyx_m); | |
| modname = PyObject_GetAttrString(spec, "name"); | |
| if (unlikely(!modname)) goto bad; | |
| module = PyModule_NewObject(modname); | |
| Py_DECREF(modname); | |
| if (unlikely(!module)) goto bad; | |
| moddict = PyModule_GetDict(module); | |
| if (unlikely(!moddict)) goto bad; | |
| if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; | |
| if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; | |
| if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; | |
| if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; | |
| return module; | |
| bad: | |
| Py_XDECREF(module); | |
| return NULL; | |
| } | |
| static CYTHON_SMALL_CODE int __pyx_pymod_exec_ccudart(PyObject *__pyx_pyinit_module) | |
| { | |
| int stringtab_initialized = 0; | |
| int pystate_addmodule_run = 0; | |
| __pyx_mstatetype *__pyx_mstate = NULL; | |
| PyObject *__pyx_t_1 = NULL; | |
| PyObject *__pyx_t_2 = NULL; | |
| PyObject *__pyx_t_3 = NULL; | |
| int __pyx_lineno = 0; | |
| const char *__pyx_filename = NULL; | |
| int __pyx_clineno = 0; | |
| __Pyx_RefNannyDeclarations | |
| if (__pyx_m) { | |
| if (__pyx_m == __pyx_pyinit_module) return 0; | |
| PyErr_SetString(PyExc_RuntimeError, "Module 'ccudart' has already been imported. Re-initialisation is not supported."); | |
| return -1; | |
| } | |
| if (__pyx_m) return __Pyx_NewRef(__pyx_m); | |
| /*--- Module creation code ---*/ | |
| __pyx_t_1 = __pyx_pyinit_module; | |
| Py_INCREF(__pyx_t_1); | |
| __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| { | |
| int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); | |
| __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "ccudart" pseudovariable */ | |
| if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
| pystate_addmodule_run = 1; | |
| } | |
| __pyx_m = __pyx_t_1; | |
| PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); | |
| __pyx_mstate = __pyx_mstate_global; | |
| CYTHON_UNUSED_VAR(__pyx_t_1); | |
| __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| Py_INCREF(__pyx_mstate->__pyx_d); | |
| __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
| /* ImportRefnannyAPI */ | |
| __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); | |
| if (!__Pyx_RefNanny) { | |
| PyErr_Clear(); | |
| __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); | |
| if (!__Pyx_RefNanny) | |
| Py_FatalError("failed to import 'refnanny' module"); | |
| } | |
| __Pyx_RefNannySetupContext("PyInit_ccudart", 0); | |
| if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __Pxy_PyFrame_Initialize_Offsets(); | |
| __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| /*--- Initialize various global constants etc. ---*/ | |
| if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| stringtab_initialized = 1; | |
| if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_CommonTypesMetaclass_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_CyFunction_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_FusedFunction_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_Coroutine_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_Generator_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__pyx_AsyncGen_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| /*--- Library function declarations ---*/ | |
| if (__pyx_module_is_main_cuda__ccudart) { | |
| if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| } | |
| { | |
| PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (!PyDict_GetItemString(modules, "cuda.ccudart")) { | |
| if (unlikely((PyDict_SetItemString(modules, "cuda.ccudart", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
| } | |
| } | |
| /*--- Builtin init code ---*/ | |
| if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| /*--- Constants init code ---*/ | |
| if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| /*--- Global type/function init code ---*/ | |
| (void)__Pyx_modinit_global_init_code(__pyx_mstate); | |
| (void)__Pyx_modinit_variable_export_code(__pyx_mstate); | |
| (void)__Pyx_modinit_function_export_code(__pyx_mstate); | |
| (void)__Pyx_modinit_type_init_code(__pyx_mstate); | |
| (void)__Pyx_modinit_type_import_code(__pyx_mstate); | |
| (void)__Pyx_modinit_variable_import_code(__pyx_mstate); | |
| (void)__Pyx_modinit_function_import_code(__pyx_mstate); | |
| /*--- Execution code ---*/ | |
| /* "cuda/ccudart.pyx":5 | |
| * | |
| * from cuda.bindings.cyruntime cimport * | |
| * from cuda.bindings import cyruntime # <<<<<<<<<<<<<< | |
| * __pyx_capi__ = cyruntime.__pyx_capi__ | |
| * del cyruntime | |
| */ | |
| __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_cyruntime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_2); | |
| __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cuda_bindings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_3); | |
| __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
| __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cyruntime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_2); | |
| if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cyruntime, __pyx_t_2) < (0)) __PYX_ERR(0, 5, __pyx_L1_error) | |
| __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
| __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
| /* "cuda/ccudart.pyx":6 | |
| * from cuda.bindings.cyruntime cimport * | |
| * from cuda.bindings import cyruntime | |
| * __pyx_capi__ = cyruntime.__pyx_capi__ # <<<<<<<<<<<<<< | |
| * del cyruntime | |
| */ | |
| __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cyruntime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_3); | |
| __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pyx_capi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_2); | |
| __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
| if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, __pyx_t_2) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) | |
| __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
| /* "cuda/ccudart.pyx":7 | |
| * from cuda.bindings import cyruntime | |
| * __pyx_capi__ = cyruntime.__pyx_capi__ | |
| * del cyruntime # <<<<<<<<<<<<<< | |
| */ | |
| if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cyruntime) < (0)) __PYX_ERR(0, 7, __pyx_L1_error) | |
| /* "cuda/ccudart.pyx":1 | |
| * # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # <<<<<<<<<<<<<< | |
| * # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE | |
| * | |
| */ | |
| __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __Pyx_GOTREF(__pyx_t_2); | |
| if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
| __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
| /*--- Wrapped vars code ---*/ | |
| goto __pyx_L0; | |
| __pyx_L1_error:; | |
| __Pyx_XDECREF(__pyx_t_2); | |
| __Pyx_XDECREF(__pyx_t_3); | |
| if (__pyx_m) { | |
| if (__pyx_mstate->__pyx_d && stringtab_initialized) { | |
| __Pyx_AddTraceback("init cuda.ccudart", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
| } | |
| Py_CLEAR(__pyx_m); | |
| Py_DECREF(__pyx_m); | |
| if (pystate_addmodule_run) { | |
| PyObject *tp, *value, *tb; | |
| PyErr_Fetch(&tp, &value, &tb); | |
| PyState_RemoveModule(&__pyx_moduledef); | |
| PyErr_Restore(tp, value, tb); | |
| } | |
| } else if (!PyErr_Occurred()) { | |
| PyErr_SetString(PyExc_ImportError, "init cuda.ccudart"); | |
| } | |
| __pyx_L0:; | |
| __Pyx_RefNannyFinishContext(); | |
| return (__pyx_m != NULL) ? 0 : -1; | |
| return __pyx_m; | |
| } | |
| /* #### Code section: pystring_table ### */ | |
| typedef struct { | |
| const char *s; | |
| const unsigned short n; | |
| const unsigned int n; | |
| const unsigned long n; | |
| const Py_ssize_t n; | |
| const unsigned int encoding : 5; | |
| const unsigned char encoding; | |
| const unsigned short encoding; | |
| const Py_ssize_t encoding; | |
| const unsigned int is_unicode : 1; | |
| const unsigned int intern : 1; | |
| } __Pyx_StringTabEntry; | |
| static const char * const __pyx_string_tab_encodings[] = { 0 }; | |
| static const __Pyx_StringTabEntry __pyx_string_tab[] = { | |
| {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ | |
| {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ | |
| {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ | |
| {__pyx_k_cuda_bindings, sizeof(__pyx_k_cuda_bindings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cuda_bindings */ | |
| {__pyx_k_cyruntime, sizeof(__pyx_k_cyruntime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cyruntime */ | |
| {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ | |
| {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ | |
| {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ | |
| {__pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_capi */ | |
| {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ | |
| {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ | |
| {0, 0, 0, 0, 0} | |
| }; | |
| /* InitStrings.proto */ | |
| static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); | |
| /* #### Code section: cached_builtins ### */ | |
| static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| return 0; | |
| } | |
| /* #### Code section: cached_constants ### */ | |
| static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { | |
| __Pyx_RefNannyDeclarations | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); | |
| __Pyx_RefNannyFinishContext(); | |
| return 0; | |
| } | |
| /* #### Code section: init_constants ### */ | |
| static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); | |
| return 0; | |
| __pyx_L1_error:; | |
| return -1; | |
| } | |
| /* #### Code section: init_codeobjects ### */ | |
| static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { | |
| CYTHON_UNUSED_VAR(__pyx_mstate); | |
| return 0; | |
| } | |
| /* #### Code section: init_globals ### */ | |
| static int __Pyx_InitGlobals(void) { | |
| /* PythonCompatibility.init */ | |
| if (likely(__Pyx_init_co_variables() == 0)); else | |
| if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) | |
| return 0; | |
| __pyx_L1_error:; | |
| return -1; | |
| } | |
| /* #### Code section: cleanup_globals ### */ | |
| /* #### Code section: cleanup_module ### */ | |
| /* #### Code section: main_method ### */ | |
| /* #### Code section: utility_code_pragmas ### */ | |
| /* Warning 4127: conditional expression is constant | |
| * Cython uses constant conditional expressions to allow in inline functions to be optimized at | |
| * compile-time, so this warning is not useful | |
| */ | |
| /* #### Code section: utility_code_def ### */ | |
| /* --- Runtime support code --- */ | |
| /* Refnanny */ | |
| static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { | |
| PyObject *m = NULL, *p = NULL; | |
| void *r = NULL; | |
| m = PyImport_ImportModule(modname); | |
| if (!m) goto end; | |
| p = PyObject_GetAttrString(m, "RefNannyAPI"); | |
| if (!p) goto end; | |
| r = PyLong_AsVoidPtr(p); | |
| end: | |
| Py_XDECREF(p); | |
| Py_XDECREF(m); | |
| return (__Pyx_RefNannyAPIStruct *)r; | |
| } | |
| /* ListPack */ | |
| static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { | |
| va_list va; | |
| PyObject *l = PyList_New(n); | |
| va_start(va, n); | |
| if (unlikely(!l)) goto end; | |
| for (Py_ssize_t i=0; i<n; ++i) { | |
| PyObject *arg = va_arg(va, PyObject*); | |
| Py_INCREF(arg); | |
| if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) { | |
| Py_CLEAR(l); | |
| goto end; | |
| } | |
| } | |
| end: | |
| va_end(va); | |
| return l; | |
| } | |
| /* PyObjectGetAttrStr */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { | |
| PyTypeObject* tp = Py_TYPE(obj); | |
| if (likely(tp->tp_getattro)) | |
| return tp->tp_getattro(obj, attr_name); | |
| return PyObject_GetAttr(obj, attr_name); | |
| } | |
| /* Import */ | |
| static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { | |
| PyObject *module = 0; | |
| PyObject *empty_dict = 0; | |
| PyObject *empty_list = 0; | |
| empty_dict = PyDict_New(); | |
| if (unlikely(!empty_dict)) | |
| goto bad; | |
| if (level == -1) { | |
| const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); | |
| if (package_sep != (0)) { | |
| module = PyImport_ImportModuleLevelObject( | |
| name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); | |
| if (unlikely(!module)) { | |
| if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) | |
| goto bad; | |
| PyErr_Clear(); | |
| } | |
| } | |
| level = 0; | |
| } | |
| if (!module) { | |
| module = PyImport_ImportModuleLevelObject( | |
| name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); | |
| } | |
| bad: | |
| Py_XDECREF(empty_dict); | |
| Py_XDECREF(empty_list); | |
| return module; | |
| } | |
| /* ImportFrom */ | |
| static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { | |
| PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); | |
| if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
| const char* module_name_str = 0; | |
| PyObject* module_name = 0; | |
| PyObject* module_dot = 0; | |
| PyObject* full_name = 0; | |
| PyErr_Clear(); | |
| module_name_str = PyModule_GetName(module); | |
| if (unlikely(!module_name_str)) { goto modbad; } | |
| module_name = PyUnicode_FromString(module_name_str); | |
| if (unlikely(!module_name)) { goto modbad; } | |
| module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_); | |
| if (unlikely(!module_dot)) { goto modbad; } | |
| full_name = PyUnicode_Concat(module_dot, name); | |
| if (unlikely(!full_name)) { goto modbad; } | |
| { | |
| PyObject *modules = PyImport_GetModuleDict(); | |
| if (unlikely(!modules)) | |
| goto modbad; | |
| value = PyObject_GetItem(modules, full_name); | |
| } | |
| value = PyImport_GetModule(full_name); | |
| modbad: | |
| Py_XDECREF(full_name); | |
| Py_XDECREF(module_dot); | |
| Py_XDECREF(module_name); | |
| } | |
| if (unlikely(!value)) { | |
| PyErr_Format(PyExc_ImportError, "cannot import name %S", name); | |
| } | |
| return value; | |
| } | |
| /* PyErrExceptionMatches */ | |
| static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
| Py_ssize_t i, n; | |
| n = PyTuple_GET_SIZE(tuple); | |
| for (i=0; i<n; i++) { | |
| if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
| } | |
| for (i=0; i<n; i++) { | |
| if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; | |
| } | |
| return 0; | |
| } | |
| static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { | |
| int result; | |
| PyObject *exc_type; | |
| PyObject *current_exception = tstate->current_exception; | |
| if (unlikely(!current_exception)) return 0; | |
| exc_type = (PyObject*) Py_TYPE(current_exception); | |
| if (exc_type == err) return 1; | |
| exc_type = tstate->curexc_type; | |
| if (exc_type == err) return 1; | |
| if (unlikely(!exc_type)) return 0; | |
| Py_INCREF(exc_type); | |
| if (unlikely(PyTuple_Check(err))) { | |
| result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); | |
| } else { | |
| result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); | |
| } | |
| Py_DECREF(exc_type); | |
| return result; | |
| } | |
| /* PyErrFetchRestore */ | |
| static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
| PyObject *tmp_value; | |
| assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); | |
| if (value) { | |
| if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) | |
| PyException_SetTraceback(value, tb); | |
| } | |
| tmp_value = tstate->current_exception; | |
| tstate->current_exception = value; | |
| Py_XDECREF(tmp_value); | |
| Py_XDECREF(type); | |
| Py_XDECREF(tb); | |
| PyObject *tmp_type, *tmp_value, *tmp_tb; | |
| tmp_type = tstate->curexc_type; | |
| tmp_value = tstate->curexc_value; | |
| tmp_tb = tstate->curexc_traceback; | |
| tstate->curexc_type = type; | |
| tstate->curexc_value = value; | |
| tstate->curexc_traceback = tb; | |
| Py_XDECREF(tmp_type); | |
| Py_XDECREF(tmp_value); | |
| Py_XDECREF(tmp_tb); | |
| } | |
| static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
| PyObject* exc_value; | |
| exc_value = tstate->current_exception; | |
| tstate->current_exception = 0; | |
| *value = exc_value; | |
| *type = NULL; | |
| *tb = NULL; | |
| if (exc_value) { | |
| *type = (PyObject*) Py_TYPE(exc_value); | |
| Py_INCREF(*type); | |
| *tb = ((PyBaseExceptionObject*) exc_value)->traceback; | |
| Py_XINCREF(*tb); | |
| *tb = PyException_GetTraceback(exc_value); | |
| } | |
| *type = tstate->curexc_type; | |
| *value = tstate->curexc_value; | |
| *tb = tstate->curexc_traceback; | |
| tstate->curexc_type = 0; | |
| tstate->curexc_value = 0; | |
| tstate->curexc_traceback = 0; | |
| } | |
| /* PyObjectGetAttrStrNoError */ | |
| static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { | |
| __Pyx_PyThreadState_declare | |
| __Pyx_PyThreadState_assign | |
| if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
| __Pyx_PyErr_Clear(); | |
| } | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { | |
| PyObject *result; | |
| (void) PyObject_GetOptionalAttr(obj, attr_name, &result); | |
| return result; | |
| PyTypeObject* tp = Py_TYPE(obj); | |
| if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { | |
| return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); | |
| } | |
| result = __Pyx_PyObject_GetAttrStr(obj, attr_name); | |
| if (unlikely(!result)) { | |
| __Pyx_PyObject_GetAttrStr_ClearAttributeError(); | |
| } | |
| return result; | |
| } | |
| /* GetBuiltinName */ | |
| static PyObject *__Pyx_GetBuiltinName(PyObject *name) { | |
| PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); | |
| if (unlikely(!result) && !PyErr_Occurred()) { | |
| PyErr_Format(PyExc_NameError, | |
| "name '%U' is not defined", name); | |
| } | |
| return result; | |
| } | |
| /* PyDictVersioning */ | |
| static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { | |
| PyObject *dict = Py_TYPE(obj)->tp_dict; | |
| return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; | |
| } | |
| static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { | |
| PyObject **dictptr = NULL; | |
| Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; | |
| if (offset) { | |
| dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); | |
| dictptr = _PyObject_GetDictPtr(obj); | |
| } | |
| return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; | |
| } | |
| static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { | |
| PyObject *dict = Py_TYPE(obj)->tp_dict; | |
| if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) | |
| return 0; | |
| return obj_dict_version == __Pyx_get_object_dict_version(obj); | |
| } | |
| /* GetModuleGlobalName */ | |
| static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) | |
| static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) | |
| { | |
| PyObject *result; | |
| if (unlikely(!__pyx_m)) { | |
| if (!PyErr_Occurred()) | |
| PyErr_SetNone(PyExc_NameError); | |
| return NULL; | |
| } | |
| result = PyObject_GetAttr(__pyx_m, name); | |
| if (likely(result)) { | |
| return result; | |
| } | |
| PyErr_Clear(); | |
| if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); | |
| __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) | |
| if (likely(result)) { | |
| return result; | |
| } | |
| result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); | |
| __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) | |
| if (likely(result)) { | |
| return __Pyx_NewRef(result); | |
| } | |
| PyErr_Clear(); | |
| return __Pyx_GetBuiltinName(name); | |
| } | |
| /* PyObjectSetAttrStr */ | |
| static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { | |
| PyTypeObject* tp = Py_TYPE(obj); | |
| if (likely(tp->tp_setattro)) | |
| return tp->tp_setattro(obj, attr_name, value); | |
| return PyObject_SetAttr(obj, attr_name, value); | |
| } | |
| /* CLineInTraceback */ | |
| static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { | |
| PyObject *use_cline; | |
| PyObject *ptype, *pvalue, *ptraceback; | |
| PyObject **cython_runtime_dict; | |
| CYTHON_MAYBE_UNUSED_VAR(tstate); | |
| if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { | |
| return c_line; | |
| } | |
| __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
| cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); | |
| if (likely(cython_runtime_dict)) { | |
| __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); | |
| __PYX_PY_DICT_LOOKUP_IF_MODIFIED( | |
| use_cline, *cython_runtime_dict, | |
| __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) | |
| Py_XINCREF(use_cline); | |
| __Pyx_END_CRITICAL_SECTION(); | |
| } else | |
| { | |
| PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); | |
| if (use_cline_obj) { | |
| use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; | |
| Py_INCREF(use_cline); | |
| Py_DECREF(use_cline_obj); | |
| } else { | |
| PyErr_Clear(); | |
| use_cline = NULL; | |
| } | |
| } | |
| if (!use_cline) { | |
| c_line = 0; | |
| (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); | |
| } | |
| else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { | |
| c_line = 0; | |
| } | |
| Py_XDECREF(use_cline); | |
| __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
| return c_line; | |
| } | |
| /* CodeObjectCache */ | |
| static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { | |
| int start = 0, mid = 0, end = count - 1; | |
| if (end >= 0 && code_line > entries[end].code_line) { | |
| return count; | |
| } | |
| while (start < end) { | |
| mid = start + (end - start) / 2; | |
| if (code_line < entries[mid].code_line) { | |
| end = mid; | |
| } else if (code_line > entries[mid].code_line) { | |
| start = mid + 1; | |
| } else { | |
| return mid; | |
| } | |
| } | |
| if (code_line <= entries[mid].code_line) { | |
| return mid; | |
| } else { | |
| return mid + 1; | |
| } | |
| } | |
| static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { | |
| __Pyx_CachedCodeObjectType* code_object; | |
| int pos; | |
| if (unlikely(!code_line) || unlikely(!code_cache->entries)) { | |
| return NULL; | |
| } | |
| pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); | |
| if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { | |
| return NULL; | |
| } | |
| code_object = code_cache->entries[pos].code_object; | |
| Py_INCREF(code_object); | |
| return code_object; | |
| } | |
| static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { | |
| (void)__pyx__find_code_object; | |
| return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. | |
| struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; | |
| __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); | |
| if (old_count < 0) { | |
| __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); | |
| return NULL; | |
| } | |
| __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); | |
| __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); | |
| return result; | |
| } | |
| static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) | |
| { | |
| int pos, i; | |
| __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; | |
| if (unlikely(!code_line)) { | |
| return; | |
| } | |
| if (unlikely(!entries)) { | |
| entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); | |
| if (likely(entries)) { | |
| code_cache->entries = entries; | |
| code_cache->max_count = 64; | |
| code_cache->count = 1; | |
| entries[0].code_line = code_line; | |
| entries[0].code_object = code_object; | |
| Py_INCREF(code_object); | |
| } | |
| return; | |
| } | |
| pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); | |
| if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { | |
| __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; | |
| entries[pos].code_object = code_object; | |
| Py_INCREF(code_object); | |
| Py_DECREF(tmp); | |
| return; | |
| } | |
| if (code_cache->count == code_cache->max_count) { | |
| int new_max = code_cache->max_count + 64; | |
| entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( | |
| code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); | |
| if (unlikely(!entries)) { | |
| return; | |
| } | |
| code_cache->entries = entries; | |
| code_cache->max_count = new_max; | |
| } | |
| for (i=code_cache->count; i>pos; i--) { | |
| entries[i] = entries[i-1]; | |
| } | |
| entries[pos].code_line = code_line; | |
| entries[pos].code_object = code_object; | |
| code_cache->count++; | |
| Py_INCREF(code_object); | |
| } | |
| static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { | |
| (void)__pyx__insert_code_object; | |
| return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. | |
| struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; | |
| __pyx_nonatomic_int_type expected = 0; | |
| if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { | |
| return; | |
| } | |
| __pyx__insert_code_object(code_cache, code_line, code_object); | |
| __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); | |
| } | |
| /* AddTraceback */ | |
| static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, | |
| PyObject *firstlineno, PyObject *name) { | |
| PyObject *replace = NULL; | |
| if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; | |
| if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; | |
| replace = PyObject_GetAttrString(code, "replace"); | |
| if (likely(replace)) { | |
| PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); | |
| Py_DECREF(replace); | |
| return result; | |
| } | |
| PyErr_Clear(); | |
| return NULL; | |
| } | |
| static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
| int py_line, const char *filename) { | |
| PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; | |
| PyObject *replace = NULL, *getframe = NULL, *frame = NULL; | |
| PyObject *exc_type, *exc_value, *exc_traceback; | |
| int success = 0; | |
| if (c_line) { | |
| (void) __pyx_cfilenm; | |
| (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); | |
| } | |
| PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); | |
| code_object = __pyx_find_code_object(c_line ? -c_line : py_line); | |
| if (!code_object) { | |
| code_object = Py_CompileString("_getframe()", filename, Py_eval_input); | |
| if (unlikely(!code_object)) goto bad; | |
| py_py_line = PyLong_FromLong(py_line); | |
| if (unlikely(!py_py_line)) goto bad; | |
| py_funcname = PyUnicode_FromString(funcname); | |
| if (unlikely(!py_funcname)) goto bad; | |
| dict = PyDict_New(); | |
| if (unlikely(!dict)) goto bad; | |
| { | |
| PyObject *old_code_object = code_object; | |
| code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); | |
| Py_DECREF(old_code_object); | |
| } | |
| if (unlikely(!code_object)) goto bad; | |
| __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); | |
| } else { | |
| dict = PyDict_New(); | |
| } | |
| getframe = PySys_GetObject("_getframe"); | |
| if (unlikely(!getframe)) goto bad; | |
| if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; | |
| frame = PyEval_EvalCode(code_object, dict, dict); | |
| if (unlikely(!frame) || frame == Py_None) goto bad; | |
| success = 1; | |
| bad: | |
| PyErr_Restore(exc_type, exc_value, exc_traceback); | |
| Py_XDECREF(code_object); | |
| Py_XDECREF(py_py_line); | |
| Py_XDECREF(py_funcname); | |
| Py_XDECREF(dict); | |
| Py_XDECREF(replace); | |
| if (success) { | |
| PyTraceBack_Here( | |
| (struct _frame*)frame); | |
| } | |
| Py_XDECREF(frame); | |
| } | |
| static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( | |
| const char *funcname, int c_line, | |
| int py_line, const char *filename) { | |
| PyCodeObject *py_code = NULL; | |
| PyObject *py_funcname = NULL; | |
| if (c_line) { | |
| py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
| if (!py_funcname) goto bad; | |
| funcname = PyUnicode_AsUTF8(py_funcname); | |
| if (!funcname) goto bad; | |
| } | |
| py_code = PyCode_NewEmpty(filename, funcname, py_line); | |
| Py_XDECREF(py_funcname); | |
| return py_code; | |
| bad: | |
| Py_XDECREF(py_funcname); | |
| return NULL; | |
| } | |
| static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
| int py_line, const char *filename) { | |
| PyCodeObject *py_code = 0; | |
| PyFrameObject *py_frame = 0; | |
| PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
| PyObject *ptype, *pvalue, *ptraceback; | |
| if (c_line) { | |
| c_line = __Pyx_CLineForTraceback(tstate, c_line); | |
| } | |
| py_code = __pyx_find_code_object(c_line ? -c_line : py_line); | |
| if (!py_code) { | |
| __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
| py_code = __Pyx_CreateCodeObjectForTraceback( | |
| funcname, c_line, py_line, filename); | |
| if (!py_code) { | |
| /* If the code object creation fails, then we should clear the | |
| fetched exception references and propagate the new exception */ | |
| Py_XDECREF(ptype); | |
| Py_XDECREF(pvalue); | |
| Py_XDECREF(ptraceback); | |
| goto bad; | |
| } | |
| __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
| __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); | |
| } | |
| py_frame = PyFrame_New( | |
| tstate, /*PyThreadState *tstate,*/ | |
| py_code, /*PyCodeObject *code,*/ | |
| __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ | |
| 0 /*PyObject *locals*/ | |
| ); | |
| if (!py_frame) goto bad; | |
| __Pyx_PyFrame_SetLineNumber(py_frame, py_line); | |
| PyTraceBack_Here(py_frame); | |
| bad: | |
| Py_XDECREF(py_code); | |
| Py_XDECREF(py_frame); | |
| } | |
| /* FormatTypeName */ | |
| static __Pyx_TypeName | |
| __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) | |
| { | |
| PyObject *module = NULL, *name = NULL, *result = NULL; | |
| name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, | |
| __pyx_mstate_global->__pyx_n_u_qualname); | |
| name = PyType_GetQualName(tp); | |
| if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; | |
| module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, | |
| __pyx_mstate_global->__pyx_n_u_module); | |
| if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; | |
| if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { | |
| result = name; | |
| name = NULL; | |
| goto done; | |
| } | |
| result = PyUnicode_FromFormat("%U.%U", module, name); | |
| if (unlikely(result == NULL)) goto bad; | |
| done: | |
| Py_XDECREF(name); | |
| Py_XDECREF(module); | |
| return result; | |
| bad: | |
| PyErr_Clear(); | |
| if (name) { | |
| result = name; | |
| name = NULL; | |
| } else { | |
| result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2); | |
| } | |
| goto done; | |
| } | |
| /* PyFunctionFastCall */ | |
| static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, | |
| PyObject *globals) { | |
| PyFrameObject *f; | |
| PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
| PyObject **fastlocals; | |
| Py_ssize_t i; | |
| PyObject *result; | |
| assert(globals != NULL); | |
| /* XXX Perhaps we should create a specialized | |
| PyFrame_New() that doesn't take locals, but does | |
| take builtins without sanity checking them. | |
| */ | |
| assert(tstate != NULL); | |
| f = PyFrame_New(tstate, co, globals, NULL); | |
| if (f == NULL) { | |
| return NULL; | |
| } | |
| fastlocals = __Pyx_PyFrame_GetLocalsplus(f); | |
| for (i = 0; i < na; i++) { | |
| Py_INCREF(*args); | |
| fastlocals[i] = *args++; | |
| } | |
| result = PyEval_EvalFrameEx(f,0); | |
| ++tstate->recursion_depth; | |
| Py_DECREF(f); | |
| --tstate->recursion_depth; | |
| return result; | |
| } | |
| static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { | |
| PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); | |
| PyObject *globals = PyFunction_GET_GLOBALS(func); | |
| PyObject *argdefs = PyFunction_GET_DEFAULTS(func); | |
| PyObject *closure; | |
| PyObject *kwdefs; | |
| PyObject *kwtuple, **k; | |
| PyObject **d; | |
| Py_ssize_t nd; | |
| Py_ssize_t nk; | |
| PyObject *result; | |
| assert(kwargs == NULL || PyDict_Check(kwargs)); | |
| nk = kwargs ? PyDict_Size(kwargs) : 0; | |
| if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { | |
| return NULL; | |
| } | |
| if ( | |
| co->co_kwonlyargcount == 0 && | |
| likely(kwargs == NULL || nk == 0) && | |
| co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { | |
| if (argdefs == NULL && co->co_argcount == nargs) { | |
| result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); | |
| goto done; | |
| } | |
| else if (nargs == 0 && argdefs != NULL | |
| && co->co_argcount == Py_SIZE(argdefs)) { | |
| /* function called with no arguments, but all parameters have | |
| a default value: use default values as arguments .*/ | |
| args = &PyTuple_GET_ITEM(argdefs, 0); | |
| result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); | |
| goto done; | |
| } | |
| } | |
| if (kwargs != NULL) { | |
| Py_ssize_t pos, i; | |
| kwtuple = PyTuple_New(2 * nk); | |
| if (kwtuple == NULL) { | |
| result = NULL; | |
| goto done; | |
| } | |
| k = &PyTuple_GET_ITEM(kwtuple, 0); | |
| pos = i = 0; | |
| while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { | |
| Py_INCREF(k[i]); | |
| Py_INCREF(k[i+1]); | |
| i += 2; | |
| } | |
| nk = i / 2; | |
| } | |
| else { | |
| kwtuple = NULL; | |
| k = NULL; | |
| } | |
| closure = PyFunction_GET_CLOSURE(func); | |
| kwdefs = PyFunction_GET_KW_DEFAULTS(func); | |
| if (argdefs != NULL) { | |
| d = &PyTuple_GET_ITEM(argdefs, 0); | |
| nd = Py_SIZE(argdefs); | |
| } | |
| else { | |
| d = NULL; | |
| nd = 0; | |
| } | |
| result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, | |
| args, (int)nargs, | |
| k, (int)nk, | |
| d, (int)nd, kwdefs, closure); | |
| Py_XDECREF(kwtuple); | |
| done: | |
| Py_LeaveRecursiveCall(); | |
| return result; | |
| } | |
| /* PyObjectCall */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
| PyObject *result; | |
| ternaryfunc call = Py_TYPE(func)->tp_call; | |
| if (unlikely(!call)) | |
| return PyObject_Call(func, arg, kw); | |
| if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
| return NULL; | |
| result = (*call)(func, arg, kw); | |
| Py_LeaveRecursiveCall(); | |
| if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
| PyErr_SetString( | |
| PyExc_SystemError, | |
| "NULL result without error in PyObject_Call"); | |
| } | |
| return result; | |
| } | |
| /* PyObjectCallMethO */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { | |
| PyObject *self, *result; | |
| PyCFunction cfunc; | |
| cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); | |
| self = __Pyx_CyOrPyCFunction_GET_SELF(func); | |
| if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
| return NULL; | |
| result = cfunc(self, arg); | |
| Py_LeaveRecursiveCall(); | |
| if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
| PyErr_SetString( | |
| PyExc_SystemError, | |
| "NULL result without error in PyObject_Call"); | |
| } | |
| return result; | |
| } | |
| /* PyObjectFastCall */ | |
| static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { | |
| PyObject *argstuple; | |
| PyObject *result = 0; | |
| size_t i; | |
| argstuple = PyTuple_New((Py_ssize_t)nargs); | |
| if (unlikely(!argstuple)) return NULL; | |
| for (i = 0; i < nargs; i++) { | |
| Py_INCREF(args[i]); | |
| if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; | |
| } | |
| result = __Pyx_PyObject_Call(func, argstuple, kwargs); | |
| bad: | |
| Py_DECREF(argstuple); | |
| return result; | |
| } | |
| static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { | |
| PyTypeObject *tp = Py_TYPE(callable); | |
| if (__Pyx_CyFunction_CheckExact(callable)) { | |
| return __Pyx_CyFunction_func_vectorcall(callable); | |
| } | |
| if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { | |
| return NULL; | |
| } | |
| assert(PyCallable_Check(callable)); | |
| Py_ssize_t offset = tp->tp_vectorcall_offset; | |
| assert(offset > 0); | |
| vectorcallfunc ptr; | |
| memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); | |
| return ptr; | |
| } | |
| static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { | |
| Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); | |
| if (nargs == 0 && kwargs == NULL) { | |
| if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) | |
| return __Pyx_PyObject_CallMethO(func, NULL); | |
| } | |
| else if (nargs == 1 && kwargs == NULL) { | |
| if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) | |
| return __Pyx_PyObject_CallMethO(func, args[0]); | |
| } | |
| if (PyCFunction_Check(func)) { | |
| if (kwargs) { | |
| return _PyCFunction_FastCallDict(func, args, nargs, kwargs); | |
| } else { | |
| return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); | |
| } | |
| } | |
| if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { | |
| return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); | |
| } | |
| if (PyFunction_Check(func)) { | |
| return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); | |
| } | |
| if (kwargs == NULL) { | |
| vectorcallfunc f = __Pyx_PyVectorcall_Function(func); | |
| if (f) { | |
| return f(func, args, _nargs, NULL); | |
| } | |
| if (__Pyx_CyFunction_CheckExact(func)) { | |
| __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); | |
| if (f) return f(func, args, _nargs, NULL); | |
| } | |
| return PyObject_Vectorcall(func, args, _nargs, NULL); | |
| } | |
| if (nargs == 0) { | |
| return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); | |
| } | |
| return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); | |
| return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); | |
| } | |
| /* PyObjectVectorCallKwBuilder */ | |
| static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { | |
| (void)__Pyx_PyObject_FastCallDict; | |
| if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; | |
| Py_INCREF(key); | |
| args[n] = value; | |
| return 0; | |
| } | |
| CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { | |
| (void)__Pyx_VectorcallBuilder_AddArgStr; | |
| if (unlikely(!PyUnicode_Check(key))) { | |
| PyErr_SetString(PyExc_TypeError, "keywords must be strings"); | |
| return -1; | |
| } | |
| return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); | |
| } | |
| static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { | |
| PyObject *pyKey = PyUnicode_FromString(key); | |
| if (!pyKey) return -1; | |
| return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); | |
| } | |
| CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { | |
| if (unlikely(!PyUnicode_Check(key))) { | |
| PyErr_SetString(PyExc_TypeError, "keywords must be strings"); | |
| return -1; | |
| } | |
| return PyDict_SetItem(builder, key, value); | |
| } | |
| /* CIntToPy */ | |
| static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { | |
| const long neg_one = (long) -1, const_zero = (long) 0; | |
| const int is_unsigned = neg_one > const_zero; | |
| if (is_unsigned) { | |
| if (sizeof(long) < sizeof(long)) { | |
| return PyLong_FromLong((long) value); | |
| } else if (sizeof(long) <= sizeof(unsigned long)) { | |
| return PyLong_FromUnsignedLong((unsigned long) value); | |
| } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { | |
| return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
| } | |
| } else { | |
| if (sizeof(long) <= sizeof(long)) { | |
| return PyLong_FromLong((long) value); | |
| } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { | |
| return PyLong_FromLongLong((PY_LONG_LONG) value); | |
| } | |
| } | |
| { | |
| unsigned char *bytes = (unsigned char *)&value; | |
| if (is_unsigned) { | |
| return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
| } else { | |
| return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
| } | |
| int one = 1; int little = (int)*(unsigned char *)&one; | |
| return _PyLong_FromByteArray(bytes, sizeof(long), | |
| little, !is_unsigned); | |
| int one = 1; int little = (int)*(unsigned char *)&one; | |
| PyObject *from_bytes, *result = NULL, *kwds = NULL; | |
| PyObject *py_bytes = NULL, *order_str = NULL; | |
| from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
| if (!from_bytes) return NULL; | |
| py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); | |
| if (!py_bytes) goto limited_bad; | |
| order_str = PyUnicode_FromString(little ? "little" : "big"); | |
| if (!order_str) goto limited_bad; | |
| { | |
| PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; | |
| if (!is_unsigned) { | |
| kwds = __Pyx_MakeVectorcallBuilderKwds(1); | |
| if (!kwds) goto limited_bad; | |
| if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; | |
| } | |
| result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); | |
| } | |
| limited_bad: | |
| Py_XDECREF(kwds); | |
| Py_XDECREF(order_str); | |
| Py_XDECREF(py_bytes); | |
| Py_XDECREF(from_bytes); | |
| return result; | |
| } | |
| } | |
| /* CIntFromPyVerify */ | |
| /* CIntFromPy */ | |
| static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { | |
| const long neg_one = (long) -1, const_zero = (long) 0; | |
| const int is_unsigned = neg_one > const_zero; | |
| if (unlikely(!PyLong_Check(x))) { | |
| long val; | |
| PyObject *tmp = __Pyx_PyNumber_Long(x); | |
| if (!tmp) return (long) -1; | |
| val = __Pyx_PyLong_As_long(tmp); | |
| Py_DECREF(tmp); | |
| return val; | |
| } | |
| if (is_unsigned) { | |
| if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
| goto raise_neg_overflow; | |
| } else if (__Pyx_PyLong_IsCompact(x)) { | |
| __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
| } else { | |
| const digit* digits = __Pyx_PyLong_Digits(x); | |
| assert(__Pyx_PyLong_DigitCount(x) > 1); | |
| switch (__Pyx_PyLong_DigitCount(x)) { | |
| case 2: | |
| if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { | |
| return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
| } | |
| } | |
| break; | |
| case 3: | |
| if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { | |
| return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
| } | |
| } | |
| break; | |
| case 4: | |
| if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { | |
| return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| if (unlikely(Py_SIZE(x) < 0)) { | |
| goto raise_neg_overflow; | |
| } | |
| { | |
| int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
| if (unlikely(result < 0)) | |
| return (long) -1; | |
| if (unlikely(result == 1)) | |
| goto raise_neg_overflow; | |
| } | |
| if ((sizeof(long) <= sizeof(unsigned long))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) | |
| } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
| } | |
| } else { | |
| if (__Pyx_PyLong_IsCompact(x)) { | |
| __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
| } else { | |
| const digit* digits = __Pyx_PyLong_Digits(x); | |
| assert(__Pyx_PyLong_DigitCount(x) > 1); | |
| switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
| case -2: | |
| if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
| return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 2: | |
| if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
| return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| case -3: | |
| if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
| return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 3: | |
| if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
| return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| case -4: | |
| if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
| return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 4: | |
| if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
| return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| if ((sizeof(long) <= sizeof(long))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) | |
| } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
| } | |
| } | |
| { | |
| long val; | |
| int ret = -1; | |
| Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
| x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
| if (unlikely(bytes_copied == -1)) { | |
| } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
| goto raise_overflow; | |
| } else { | |
| ret = 0; | |
| } | |
| int one = 1; int is_little = (int)*(unsigned char *)&one; | |
| unsigned char *bytes = (unsigned char *)&val; | |
| ret = _PyLong_AsByteArray((PyLongObject *)x, | |
| bytes, sizeof(val), | |
| is_little, !is_unsigned); | |
| PyObject *v; | |
| PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
| int bits, remaining_bits, is_negative = 0; | |
| int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
| if (likely(PyLong_CheckExact(x))) { | |
| v = __Pyx_NewRef(x); | |
| } else { | |
| v = PyNumber_Long(x); | |
| if (unlikely(!v)) return (long) -1; | |
| assert(PyLong_CheckExact(v)); | |
| } | |
| { | |
| int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
| if (unlikely(result < 0)) { | |
| Py_DECREF(v); | |
| return (long) -1; | |
| } | |
| is_negative = result == 1; | |
| } | |
| if (is_unsigned && unlikely(is_negative)) { | |
| Py_DECREF(v); | |
| goto raise_neg_overflow; | |
| } else if (is_negative) { | |
| stepval = PyNumber_Invert(v); | |
| Py_DECREF(v); | |
| if (unlikely(!stepval)) | |
| return (long) -1; | |
| } else { | |
| stepval = v; | |
| } | |
| v = NULL; | |
| val = (long) 0; | |
| mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
| shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
| for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { | |
| PyObject *tmp, *digit; | |
| long idigit; | |
| digit = PyNumber_And(stepval, mask); | |
| if (unlikely(!digit)) goto done; | |
| idigit = PyLong_AsLong(digit); | |
| Py_DECREF(digit); | |
| if (unlikely(idigit < 0)) goto done; | |
| val |= ((long) idigit) << bits; | |
| tmp = PyNumber_Rshift(stepval, shift); | |
| if (unlikely(!tmp)) goto done; | |
| Py_DECREF(stepval); stepval = tmp; | |
| } | |
| Py_DECREF(shift); shift = NULL; | |
| Py_DECREF(mask); mask = NULL; | |
| { | |
| long idigit = PyLong_AsLong(stepval); | |
| if (unlikely(idigit < 0)) goto done; | |
| remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); | |
| if (unlikely(idigit >= (1L << remaining_bits))) | |
| goto raise_overflow; | |
| val |= ((long) idigit) << bits; | |
| } | |
| if (!is_unsigned) { | |
| if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) | |
| goto raise_overflow; | |
| if (is_negative) | |
| val = ~val; | |
| } | |
| ret = 0; | |
| done: | |
| Py_XDECREF(shift); | |
| Py_XDECREF(mask); | |
| Py_XDECREF(stepval); | |
| if (unlikely(ret)) | |
| return (long) -1; | |
| return val; | |
| } | |
| raise_overflow: | |
| PyErr_SetString(PyExc_OverflowError, | |
| "value too large to convert to long"); | |
| return (long) -1; | |
| raise_neg_overflow: | |
| PyErr_SetString(PyExc_OverflowError, | |
| "can't convert negative value to long"); | |
| return (long) -1; | |
| } | |
| /* CIntFromPy */ | |
| static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { | |
| const int neg_one = (int) -1, const_zero = (int) 0; | |
| const int is_unsigned = neg_one > const_zero; | |
| if (unlikely(!PyLong_Check(x))) { | |
| int val; | |
| PyObject *tmp = __Pyx_PyNumber_Long(x); | |
| if (!tmp) return (int) -1; | |
| val = __Pyx_PyLong_As_int(tmp); | |
| Py_DECREF(tmp); | |
| return val; | |
| } | |
| if (is_unsigned) { | |
| if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
| goto raise_neg_overflow; | |
| } else if (__Pyx_PyLong_IsCompact(x)) { | |
| __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
| } else { | |
| const digit* digits = __Pyx_PyLong_Digits(x); | |
| assert(__Pyx_PyLong_DigitCount(x) > 1); | |
| switch (__Pyx_PyLong_DigitCount(x)) { | |
| case 2: | |
| if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { | |
| return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
| } | |
| } | |
| break; | |
| case 3: | |
| if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { | |
| return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
| } | |
| } | |
| break; | |
| case 4: | |
| if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { | |
| return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| if (unlikely(Py_SIZE(x) < 0)) { | |
| goto raise_neg_overflow; | |
| } | |
| { | |
| int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
| if (unlikely(result < 0)) | |
| return (int) -1; | |
| if (unlikely(result == 1)) | |
| goto raise_neg_overflow; | |
| } | |
| if ((sizeof(int) <= sizeof(unsigned long))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) | |
| } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
| } | |
| } else { | |
| if (__Pyx_PyLong_IsCompact(x)) { | |
| __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
| } else { | |
| const digit* digits = __Pyx_PyLong_Digits(x); | |
| assert(__Pyx_PyLong_DigitCount(x) > 1); | |
| switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
| case -2: | |
| if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
| return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 2: | |
| if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
| return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| case -3: | |
| if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
| return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 3: | |
| if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
| return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| case -4: | |
| if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
| return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| case 4: | |
| if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
| if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
| __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
| } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
| return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| if ((sizeof(int) <= sizeof(long))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) | |
| } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { | |
| __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
| } | |
| } | |
| { | |
| int val; | |
| int ret = -1; | |
| Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
| x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
| if (unlikely(bytes_copied == -1)) { | |
| } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
| goto raise_overflow; | |
| } else { | |
| ret = 0; | |
| } | |
| int one = 1; int is_little = (int)*(unsigned char *)&one; | |
| unsigned char *bytes = (unsigned char *)&val; | |
| ret = _PyLong_AsByteArray((PyLongObject *)x, | |
| bytes, sizeof(val), | |
| is_little, !is_unsigned); | |
| PyObject *v; | |
| PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
| int bits, remaining_bits, is_negative = 0; | |
| int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
| if (likely(PyLong_CheckExact(x))) { | |
| v = __Pyx_NewRef(x); | |
| } else { | |
| v = PyNumber_Long(x); | |
| if (unlikely(!v)) return (int) -1; | |
| assert(PyLong_CheckExact(v)); | |
| } | |
| { | |
| int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
| if (unlikely(result < 0)) { | |
| Py_DECREF(v); | |
| return (int) -1; | |
| } | |
| is_negative = result == 1; | |
| } | |
| if (is_unsigned && unlikely(is_negative)) { | |
| Py_DECREF(v); | |
| goto raise_neg_overflow; | |
| } else if (is_negative) { | |
| stepval = PyNumber_Invert(v); | |
| Py_DECREF(v); | |
| if (unlikely(!stepval)) | |
| return (int) -1; | |
| } else { | |
| stepval = v; | |
| } | |
| v = NULL; | |
| val = (int) 0; | |
| mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
| shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
| for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { | |
| PyObject *tmp, *digit; | |
| long idigit; | |
| digit = PyNumber_And(stepval, mask); | |
| if (unlikely(!digit)) goto done; | |
| idigit = PyLong_AsLong(digit); | |
| Py_DECREF(digit); | |
| if (unlikely(idigit < 0)) goto done; | |
| val |= ((int) idigit) << bits; | |
| tmp = PyNumber_Rshift(stepval, shift); | |
| if (unlikely(!tmp)) goto done; | |
| Py_DECREF(stepval); stepval = tmp; | |
| } | |
| Py_DECREF(shift); shift = NULL; | |
| Py_DECREF(mask); mask = NULL; | |
| { | |
| long idigit = PyLong_AsLong(stepval); | |
| if (unlikely(idigit < 0)) goto done; | |
| remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); | |
| if (unlikely(idigit >= (1L << remaining_bits))) | |
| goto raise_overflow; | |
| val |= ((int) idigit) << bits; | |
| } | |
| if (!is_unsigned) { | |
| if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) | |
| goto raise_overflow; | |
| if (is_negative) | |
| val = ~val; | |
| } | |
| ret = 0; | |
| done: | |
| Py_XDECREF(shift); | |
| Py_XDECREF(mask); | |
| Py_XDECREF(stepval); | |
| if (unlikely(ret)) | |
| return (int) -1; | |
| return val; | |
| } | |
| raise_overflow: | |
| PyErr_SetString(PyExc_OverflowError, | |
| "value too large to convert to int"); | |
| return (int) -1; | |
| raise_neg_overflow: | |
| PyErr_SetString(PyExc_OverflowError, | |
| "can't convert negative value to int"); | |
| return (int) -1; | |
| } | |
| /* FastTypeChecks */ | |
| static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { | |
| while (a) { | |
| a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); | |
| if (a == b) | |
| return 1; | |
| } | |
| return b == &PyBaseObject_Type; | |
| } | |
| static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { | |
| PyObject *mro; | |
| if (a == b) return 1; | |
| mro = a->tp_mro; | |
| if (likely(mro)) { | |
| Py_ssize_t i, n; | |
| n = PyTuple_GET_SIZE(mro); | |
| for (i = 0; i < n; i++) { | |
| if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) | |
| return 1; | |
| } | |
| return 0; | |
| } | |
| return __Pyx_InBases(a, b); | |
| } | |
| static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { | |
| PyObject *mro; | |
| if (cls == a || cls == b) return 1; | |
| mro = cls->tp_mro; | |
| if (likely(mro)) { | |
| Py_ssize_t i, n; | |
| n = PyTuple_GET_SIZE(mro); | |
| for (i = 0; i < n; i++) { | |
| PyObject *base = PyTuple_GET_ITEM(mro, i); | |
| if (base == (PyObject *)a || base == (PyObject *)b) | |
| return 1; | |
| } | |
| return 0; | |
| } | |
| return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); | |
| } | |
| static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { | |
| if (exc_type1) { | |
| return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); | |
| } else { | |
| return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); | |
| } | |
| } | |
| static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
| Py_ssize_t i, n; | |
| assert(PyExceptionClass_Check(exc_type)); | |
| n = PyTuple_GET_SIZE(tuple); | |
| for (i=0; i<n; i++) { | |
| if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
| } | |
| for (i=0; i<n; i++) { | |
| PyObject *t = PyTuple_GET_ITEM(tuple, i); | |
| if (likely(PyExceptionClass_Check(t))) { | |
| if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; | |
| } else { | |
| } | |
| } | |
| return 0; | |
| } | |
| static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { | |
| if (likely(err == exc_type)) return 1; | |
| if (likely(PyExceptionClass_Check(err))) { | |
| if (likely(PyExceptionClass_Check(exc_type))) { | |
| return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); | |
| } else if (likely(PyTuple_Check(exc_type))) { | |
| return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); | |
| } else { | |
| } | |
| } | |
| return PyErr_GivenExceptionMatches(err, exc_type); | |
| } | |
| static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { | |
| assert(PyExceptionClass_Check(exc_type1)); | |
| assert(PyExceptionClass_Check(exc_type2)); | |
| if (likely(err == exc_type1 || err == exc_type2)) return 1; | |
| if (likely(PyExceptionClass_Check(err))) { | |
| return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); | |
| } | |
| return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); | |
| } | |
| /* GetRuntimeVersion */ | |
| static unsigned long __Pyx_get_runtime_version(void) { | |
| return Py_Version & ~0xFFUL; | |
| static unsigned long __Pyx_cached_runtime_version = 0; | |
| if (__Pyx_cached_runtime_version == 0) { | |
| const char* rt_version = Py_GetVersion(); | |
| unsigned long version = 0; | |
| unsigned long factor = 0x01000000UL; | |
| unsigned int digit = 0; | |
| int i = 0; | |
| while (factor) { | |
| while ('0' <= rt_version[i] && rt_version[i] <= '9') { | |
| digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); | |
| ++i; | |
| } | |
| version += factor * digit; | |
| if (rt_version[i] != '.') | |
| break; | |
| digit = 0; | |
| factor >>= 8; | |
| ++i; | |
| } | |
| __Pyx_cached_runtime_version = version; | |
| } | |
| return __Pyx_cached_runtime_version; | |
| } | |
| /* CheckBinaryVersion */ | |
| static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { | |
| const unsigned long MAJOR_MINOR = 0xFFFF0000UL; | |
| if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) | |
| return 0; | |
| if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) | |
| return 1; | |
| { | |
| char message[200]; | |
| PyOS_snprintf(message, sizeof(message), | |
| "compile time Python version %d.%d " | |
| "of module '%.100s' " | |
| "%s " | |
| "runtime version %d.%d", | |
| (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), | |
| __Pyx_MODULE_NAME, | |
| (allow_newer) ? "was newer than" : "does not match", | |
| (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) | |
| ); | |
| return PyErr_WarnEx(NULL, message, 1); | |
| } | |
| } | |
| /* InitStrings */ | |
| static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { | |
| while (t->s) { | |
| PyObject *str; | |
| if (t->is_unicode) { | |
| if (t->intern) { | |
| str = PyUnicode_InternFromString(t->s); | |
| } else if (t->encoding) { | |
| str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); | |
| } else { | |
| str = PyUnicode_FromStringAndSize(t->s, t->n - 1); | |
| } | |
| } else { | |
| str = PyBytes_FromStringAndSize(t->s, t->n - 1); | |
| } | |
| if (!str) | |
| return -1; | |
| *target = str; | |
| if (PyObject_Hash(str) == -1) | |
| return -1; | |
| ++t; | |
| ++target; | |
| } | |
| return 0; | |
| } | |
| static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { | |
| size_t len = strlen(s); | |
| if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { | |
| PyErr_SetString(PyExc_OverflowError, "byte string is too long"); | |
| return -1; | |
| } | |
| return (Py_ssize_t) len; | |
| } | |
| static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { | |
| Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
| if (unlikely(len < 0)) return NULL; | |
| return __Pyx_PyUnicode_FromStringAndSize(c_str, len); | |
| } | |
| static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { | |
| Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
| if (unlikely(len < 0)) return NULL; | |
| return PyByteArray_FromStringAndSize(c_str, len); | |
| } | |
| static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { | |
| Py_ssize_t ignore; | |
| return __Pyx_PyObject_AsStringAndSize(o, &ignore); | |
| } | |
| static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
| if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; | |
| { | |
| const char* result; | |
| Py_ssize_t unicode_length; | |
| CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
| if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; | |
| result = PyUnicode_AsUTF8AndSize(o, length); | |
| unicode_length = PyUnicode_GetLength(o); | |
| if (unlikely(unicode_length < 0)) return NULL; | |
| if (unlikely(unicode_length != *length)) { | |
| PyUnicode_AsASCIIString(o); | |
| return NULL; | |
| } | |
| return result; | |
| } | |
| if (likely(PyUnicode_IS_ASCII(o))) { | |
| *length = PyUnicode_GET_LENGTH(o); | |
| return PyUnicode_AsUTF8(o); | |
| } else { | |
| PyUnicode_AsASCIIString(o); | |
| return NULL; | |
| } | |
| return PyUnicode_AsUTF8AndSize(o, length); | |
| } | |
| static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
| if (PyUnicode_Check(o)) { | |
| return __Pyx_PyUnicode_AsStringAndSize(o, length); | |
| } else | |
| if (PyByteArray_Check(o)) { | |
| *length = PyByteArray_GET_SIZE(o); | |
| return PyByteArray_AS_STRING(o); | |
| *length = PyByteArray_Size(o); | |
| if (*length == -1) return NULL; | |
| return PyByteArray_AsString(o); | |
| } else | |
| { | |
| char* result; | |
| int r = PyBytes_AsStringAndSize(o, &result, length); | |
| if (unlikely(r < 0)) { | |
| return NULL; | |
| } else { | |
| return result; | |
| } | |
| } | |
| } | |
| static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { | |
| int is_true = x == Py_True; | |
| if (is_true | (x == Py_False) | (x == Py_None)) return is_true; | |
| else return PyObject_IsTrue(x); | |
| } | |
| static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { | |
| int retval; | |
| if (unlikely(!x)) return -1; | |
| retval = __Pyx_PyObject_IsTrue(x); | |
| Py_DECREF(x); | |
| return retval; | |
| } | |
| static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { | |
| __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); | |
| if (PyLong_Check(result)) { | |
| if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | |
| "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " | |
| "The ability to return an instance of a strict subclass of int is deprecated, " | |
| "and may be removed in a future version of Python.", | |
| result_type_name)) { | |
| __Pyx_DECREF_TypeName(result_type_name); | |
| Py_DECREF(result); | |
| return NULL; | |
| } | |
| __Pyx_DECREF_TypeName(result_type_name); | |
| return result; | |
| } | |
| PyErr_Format(PyExc_TypeError, | |
| "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", | |
| result_type_name); | |
| __Pyx_DECREF_TypeName(result_type_name); | |
| Py_DECREF(result); | |
| return NULL; | |
| } | |
| static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { | |
| PyNumberMethods *m; | |
| PyObject *res = NULL; | |
| if (likely(PyLong_Check(x))) | |
| return __Pyx_NewRef(x); | |
| m = Py_TYPE(x)->tp_as_number; | |
| if (likely(m && m->nb_int)) { | |
| res = m->nb_int(x); | |
| } | |
| if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { | |
| res = PyNumber_Long(x); | |
| } | |
| if (likely(res)) { | |
| if (unlikely(!PyLong_CheckExact(res))) { | |
| return __Pyx_PyNumber_LongWrongResultType(res); | |
| } | |
| } | |
| else if (!PyErr_Occurred()) { | |
| PyErr_SetString(PyExc_TypeError, | |
| "an integer is required"); | |
| } | |
| return res; | |
| } | |
| static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { | |
| Py_ssize_t ival; | |
| PyObject *x; | |
| if (likely(PyLong_CheckExact(b))) { | |
| if (likely(__Pyx_PyLong_IsCompact(b))) { | |
| return __Pyx_PyLong_CompactValue(b); | |
| } else { | |
| const digit* digits = __Pyx_PyLong_Digits(b); | |
| const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); | |
| switch (size) { | |
| case 2: | |
| if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
| return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| case -2: | |
| if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
| return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| case 3: | |
| if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
| return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| case -3: | |
| if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
| return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| case 4: | |
| if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
| return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| case -4: | |
| if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
| return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
| } | |
| break; | |
| } | |
| } | |
| return PyLong_AsSsize_t(b); | |
| } | |
| x = PyNumber_Index(b); | |
| if (!x) return -1; | |
| ival = PyLong_AsSsize_t(x); | |
| Py_DECREF(x); | |
| return ival; | |
| } | |
| static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { | |
| if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { | |
| return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); | |
| } else { | |
| Py_ssize_t ival; | |
| PyObject *x; | |
| x = PyNumber_Index(o); | |
| if (!x) return -1; | |
| ival = PyLong_AsLong(x); | |
| Py_DECREF(x); | |
| return ival; | |
| } | |
| } | |
| static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { | |
| CYTHON_UNUSED_VAR(b); | |
| return __Pyx_NewRef(Py_None); | |
| } | |
| static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { | |
| return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); | |
| } | |
| static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { | |
| return PyLong_FromSize_t(ival); | |
| } | |
| static CYTHON_INLINE int __Pyx_PyLong_CompactAsLong(PyObject *x, long *return_value) { | |
| if (unlikely(!__Pyx_PyLong_IsCompact(x))) | |
| return 0; | |
| Py_ssize_t value = __Pyx_PyLong_CompactValue(x); | |
| if ((sizeof(long) < sizeof(Py_ssize_t)) && unlikely(value != (long) value)) | |
| return 0; | |
| *return_value = (long) value; | |
| return 1; | |
| } | |
| /* MultiPhaseInitModuleState */ | |
| static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; | |
| static std::mutex __Pyx_ModuleStateLookup_mutex; | |
| static mtx_t __Pyx_ModuleStateLookup_mutex; | |
| static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; | |
| static void __Pyx_ModuleStateLookup_initialize_mutex(void) { | |
| mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); | |
| } | |
| static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; | |
| static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; | |
| typedef struct { | |
| int64_t id; | |
| PyObject *module; | |
| } __Pyx_InterpreterIdAndModule; | |
| typedef struct { | |
| char interpreter_id_as_index; | |
| Py_ssize_t count; | |
| Py_ssize_t allocated; | |
| __Pyx_InterpreterIdAndModule table[1]; | |
| } __Pyx_ModuleStateLookupData; | |
| static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; | |
| static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; | |
| static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; | |
| static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( | |
| __Pyx_InterpreterIdAndModule* table, | |
| Py_ssize_t count, | |
| int64_t interpreterId) { | |
| __Pyx_InterpreterIdAndModule* begin = table; | |
| __Pyx_InterpreterIdAndModule* end = begin + count; | |
| if (begin->id == interpreterId) { | |
| return begin; | |
| } | |
| while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { | |
| __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; | |
| if (halfway->id == interpreterId) { | |
| return halfway; | |
| } | |
| if (halfway->id < interpreterId) { | |
| begin = halfway; | |
| } else { | |
| end = halfway; | |
| } | |
| } | |
| for (; begin < end; ++begin) { | |
| if (begin->id >= interpreterId) return begin; | |
| } | |
| return begin; | |
| } | |
| static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { | |
| int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); | |
| if (interpreter_id == -1) return NULL; | |
| __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); | |
| { | |
| __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); | |
| if (likely(data)) { | |
| __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); | |
| if (likely(data == new_data)) { | |
| goto read_finished; | |
| } | |
| } | |
| __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); | |
| __Pyx_ModuleStateLookup_Lock(); | |
| __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); | |
| data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); | |
| __Pyx_ModuleStateLookup_Unlock(); | |
| } | |
| read_finished:; | |
| __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; | |
| __Pyx_InterpreterIdAndModule* found = NULL; | |
| if (unlikely(!data)) goto end; | |
| if (data->interpreter_id_as_index) { | |
| if (interpreter_id < data->count) { | |
| found = data->table+interpreter_id; | |
| } | |
| } else { | |
| found = __Pyx_State_FindModuleStateLookupTableLowerBound( | |
| data->table, data->count, interpreter_id); | |
| } | |
| end: | |
| { | |
| PyObject *result=NULL; | |
| if (found && found->id == interpreter_id) { | |
| result = found->module; | |
| } | |
| __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); | |
| return result; | |
| } | |
| } | |
| static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { | |
| while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); | |
| } | |
| static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { | |
| Py_ssize_t to_allocate = (*old_data)->allocated; | |
| while (to_allocate <= interpreter_id) { | |
| if (to_allocate == 0) to_allocate = 1; | |
| else to_allocate *= 2; | |
| } | |
| __Pyx_ModuleStateLookupData *new_data = *old_data; | |
| if (to_allocate != (*old_data)->allocated) { | |
| new_data = (__Pyx_ModuleStateLookupData *)realloc( | |
| *old_data, | |
| sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); | |
| if (!new_data) { | |
| PyErr_NoMemory(); | |
| return -1; | |
| } | |
| for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { | |
| new_data->table[i].id = i; | |
| new_data->table[i].module = NULL; | |
| } | |
| new_data->allocated = to_allocate; | |
| } | |
| new_data->table[interpreter_id].module = module; | |
| if (new_data->count < interpreter_id+1) { | |
| new_data->count = interpreter_id+1; | |
| } | |
| *old_data = new_data; | |
| return 0; | |
| } | |
| static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { | |
| __Pyx_InterpreterIdAndModule *read = data->table; | |
| __Pyx_InterpreterIdAndModule *write = data->table; | |
| __Pyx_InterpreterIdAndModule *end = read + data->count; | |
| for (; read<end; ++read) { | |
| if (read->module) { | |
| write->id = read->id; | |
| write->module = read->module; | |
| ++write; | |
| } | |
| } | |
| data->count = write - data->table; | |
| for (; write<end; ++write) { | |
| write->id = 0; | |
| write->module = NULL; | |
| } | |
| data->interpreter_id_as_index = 0; | |
| } | |
| static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { | |
| int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); | |
| if (interpreter_id == -1) return -1; | |
| int result = 0; | |
| __Pyx_ModuleStateLookup_Lock(); | |
| __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) | |
| __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); | |
| __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; | |
| __Pyx_ModuleStateLookupData *new_data = old_data; | |
| if (!new_data) { | |
| new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); | |
| if (!new_data) { | |
| result = -1; | |
| PyErr_NoMemory(); | |
| goto end; | |
| } | |
| new_data->allocated = 1; | |
| new_data->interpreter_id_as_index = 1; | |
| } | |
| __Pyx_ModuleStateLookup_wait_until_no_readers(); | |
| if (new_data->interpreter_id_as_index) { | |
| if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { | |
| result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); | |
| goto end; | |
| } | |
| __Pyx_State_ConvertFromInterpIdAsIndex(new_data); | |
| } | |
| { | |
| Py_ssize_t insert_at = 0; | |
| { | |
| __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( | |
| new_data->table, new_data->count, interpreter_id); | |
| assert(lower_bound); | |
| insert_at = lower_bound - new_data->table; | |
| if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { | |
| lower_bound->module = module; | |
| goto end; // already in table, nothing more to do | |
| } | |
| } | |
| if (new_data->count+1 >= new_data->allocated) { | |
| Py_ssize_t to_allocate = (new_data->count+1)*2; | |
| new_data = | |
| (__Pyx_ModuleStateLookupData*)realloc( | |
| new_data, | |
| sizeof(__Pyx_ModuleStateLookupData) + | |
| (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); | |
| if (!new_data) { | |
| result = -1; | |
| new_data = old_data; | |
| PyErr_NoMemory(); | |
| goto end; | |
| } | |
| new_data->allocated = to_allocate; | |
| } | |
| ++new_data->count; | |
| int64_t last_id = interpreter_id; | |
| PyObject *last_module = module; | |
| for (Py_ssize_t i=insert_at; i<new_data->count; ++i) { | |
| int64_t current_id = new_data->table[i].id; | |
| new_data->table[i].id = last_id; | |
| last_id = current_id; | |
| PyObject *current_module = new_data->table[i].module; | |
| new_data->table[i].module = last_module; | |
| last_module = current_module; | |
| } | |
| } | |
| end: | |
| __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); | |
| __Pyx_ModuleStateLookup_data = new_data; | |
| __Pyx_ModuleStateLookup_Unlock(); | |
| return result; | |
| } | |
| static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { | |
| int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); | |
| if (interpreter_id == -1) return -1; | |
| __Pyx_ModuleStateLookup_Lock(); | |
| __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) | |
| __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); | |
| __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; | |
| if (data->interpreter_id_as_index) { | |
| if (interpreter_id < data->count) { | |
| data->table[interpreter_id].module = NULL; | |
| } | |
| goto done; | |
| } | |
| { | |
| __Pyx_ModuleStateLookup_wait_until_no_readers(); | |
| __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( | |
| data->table, data->count, interpreter_id); | |
| if (!lower_bound) goto done; | |
| if (lower_bound->id != interpreter_id) goto done; | |
| __Pyx_InterpreterIdAndModule *end = data->table+data->count; | |
| for (;lower_bound<end-1; ++lower_bound) { | |
| lower_bound->id = (lower_bound+1)->id; | |
| lower_bound->module = (lower_bound+1)->module; | |
| } | |
| } | |
| --data->count; | |
| if (data->count == 0) { | |
| free(data); | |
| data = NULL; | |
| } | |
| done: | |
| __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); | |
| __Pyx_ModuleStateLookup_data = data; | |
| __Pyx_ModuleStateLookup_Unlock(); | |
| return 0; | |
| } | |
| /* #### Code section: utility_code_pragmas_end ### */ | |
| /* #### Code section: end ### */ | |