/* Generated by Cython 0.29.34 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/io/cuda-python-build-utils/conda-recipe/include/cuda.h",
            "/io/cuda-python-build-utils/conda-recipe/include/cudaProfiler.h",
            "/io/cuda-python-build-utils/conda-recipe/include/cuda_runtime.h",
            "/io/cuda-python-build-utils/conda-recipe/include/driver_types.h",
            "cuda"
        ],
        "extra_compile_args": [
            "-std=c++14",
            "-fpermissive",
            "-Wno-deprecated-declarations",
            "-D _GLIBCXX_ASSERTIONS",
            "-fno-var-tracking-assignments",
            "-O3"
        ],
        "include_dirs": [
            "./cuda",
            "/opt/conda/conda-bld/cuda-python_1684128562024/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/include",
            "/io/cuda-python-build-utils/conda-recipe/include"
        ],
        "language": "c++",
        "library_dirs": [
            "/opt/conda/conda-bld/cuda-python_1684128562024/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.8/site-packages",
            "/opt/conda/conda-bld/cuda-python_1684128562024/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib"
        ],
        "name": "cuda._lib.ccudart.ccudart",
        "sources": [
            "cuda/_lib/ccudart/ccudart.pyx"
        ]
    },
    "module_name": "cuda._lib.ccudart.ccudart"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_34"
#define CYTHON_HEX_VERSION 0x001D22F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PY_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 0
  #elif !defined(CYTHON_FAST_THREAD_STATE)
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
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 ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  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);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__cuda___lib__ccudart__ccudart
#define __PYX_HAVE_API__cuda___lib__ccudart__ccudart
/* Early includes */
#include <stdint.h>
#include "cuda.h"
#include "cudaProfiler.h"
#include "driver_types.h"
#include "cuda_runtime.h"
#include <string.h>
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
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_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "cuda/_lib/ccudart/ccudart.pyx",
  "cuda/_lib/ccudart/utils.pxd",
};
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()


/* "cuda/ccuda.pxd":2473
 * 
 * 
 * ctypedef unsigned int GLenum             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int GLuint
 */
typedef unsigned int __pyx_t_4cuda_5ccuda_GLenum;

/* "cuda/ccuda.pxd":2475
 * ctypedef unsigned int GLenum
 * 
 * ctypedef unsigned int GLuint             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef unsigned int __pyx_t_4cuda_5ccuda_GLuint;

/* "cuda/ccuda.pxd":2487
 * ctypedef void* EGLStreamKHR
 * 
 * ctypedef unsigned int EGLint             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef unsigned int __pyx_t_4cuda_5ccuda_EGLint;

/* "cuda/ccuda.pxd":2494
 * ctypedef void* EGLSyncKHR
 * 
 * ctypedef uint32_t VdpDevice             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long VdpGetProcAddress
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_VdpDevice;

/* "cuda/ccuda.pxd":2496
 * ctypedef uint32_t VdpDevice
 * 
 * ctypedef unsigned long long VdpGetProcAddress             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpVideoSurface
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_5ccuda_VdpGetProcAddress;

/* "cuda/ccuda.pxd":2498
 * ctypedef unsigned long long VdpGetProcAddress
 * 
 * ctypedef uint32_t VdpVideoSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpOutputSurface
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_VdpVideoSurface;

/* "cuda/ccuda.pxd":2500
 * ctypedef uint32_t VdpVideoSurface
 * 
 * ctypedef uint32_t VdpOutputSurface             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) nogil except ?CUDA_ERROR_NOT_FOUND
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_VdpOutputSurface;

/* "cuda/ccudart.pxd":1084
 * 
 * 
 * ctypedef unsigned int GLenum             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int GLuint
 */
typedef unsigned int __pyx_t_4cuda_7ccudart_GLenum;

/* "cuda/ccudart.pxd":1086
 * ctypedef unsigned int GLenum
 * 
 * ctypedef unsigned int GLuint             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef unsigned int __pyx_t_4cuda_7ccudart_GLuint;

/* "cuda/ccudart.pxd":1098
 * ctypedef void* EGLStreamKHR
 * 
 * ctypedef unsigned int EGLint             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef unsigned int __pyx_t_4cuda_7ccudart_EGLint;

/* "cuda/ccudart.pxd":1105
 * ctypedef void* EGLSyncKHR
 * 
 * ctypedef uint32_t VdpDevice             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long VdpGetProcAddress
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpDevice;

/* "cuda/ccudart.pxd":1107
 * ctypedef uint32_t VdpDevice
 * 
 * ctypedef unsigned long long VdpGetProcAddress             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpVideoSurface
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_7ccudart_VdpGetProcAddress;

/* "cuda/ccudart.pxd":1109
 * ctypedef unsigned long long VdpGetProcAddress
 * 
 * ctypedef uint32_t VdpVideoSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpOutputSurface
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpVideoSurface;

/* "cuda/ccudart.pxd":1111
 * ctypedef uint32_t VdpVideoSurface
 * 
 * ctypedef uint32_t VdpOutputSurface             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGLDeviceList:
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpOutputSurface;

/*--- Type declarations ---*/
struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
union __pyx_t_4cuda_5ccuda__CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u;
struct __pyx_t_4cuda_5ccuda_CUeglFrame_st;

/* "cuda/ccuda.pxd":2511
 * 
 * 
 * cdef enum CUeglFrameType_enum:             # <<<<<<<<<<<<<<
 *     CU_EGL_FRAME_TYPE_ARRAY = 0
 *     CU_EGL_FRAME_TYPE_PITCH = 1
 */
enum __pyx_t_4cuda_5ccuda_CUeglFrameType_enum {
  __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_ARRAY = 0,
  __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_PITCH = 1
};

/* "cuda/ccuda.pxd":2517
 * ctypedef CUeglFrameType_enum CUeglFrameType
 * 
 * cdef enum CUeglResourceLocationFlags_enum:             # <<<<<<<<<<<<<<
 *     CU_EGL_RESOURCE_LOCATION_SYSMEM = 0
 *     CU_EGL_RESOURCE_LOCATION_VIDMEM = 1
 */
enum __pyx_t_4cuda_5ccuda_CUeglResourceLocationFlags_enum {
  __pyx_e_4cuda_5ccuda_CU_EGL_RESOURCE_LOCATION_SYSMEM = 0,
  __pyx_e_4cuda_5ccuda_CU_EGL_RESOURCE_LOCATION_VIDMEM = 1
};

/* "cuda/ccuda.pxd":2523
 * ctypedef CUeglResourceLocationFlags_enum CUeglResourceLocationFlags
 * 
 * cdef enum CUeglColorFormat_enum:             # <<<<<<<<<<<<<<
 *     CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0
 *     CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 1
 */
enum __pyx_t_4cuda_5ccuda_CUeglColorFormat_enum {
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 1,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR = 2,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR = 3,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RGB = 4,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BGR = 5,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ARGB = 6,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RGBA = 7,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_L = 8,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_R = 9,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR = 10,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR = 11,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_422 = 12,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_422 = 13,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ABGR = 14,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BGRA = 15,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_A = 16,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RG = 17,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV = 18,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR = 19,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR = 20,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = 21,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR = 22,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = 23,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR = 24,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = 25,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY_ER = 26,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_ER = 27,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_ER = 28,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU_ER = 29,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV_ER = 30,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA_ER = 31,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV_ER = 32,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER = 33,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER = 34,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER = 35,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER = 36,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER = 37,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER = 38,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER = 39,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER = 40,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER = 41,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER = 42,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER = 43,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER = 44,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RGGB = 45,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BGGR = 46,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GRBG = 47,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GBRG = 48,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_RGGB = 49,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_BGGR = 50,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GRBG = 51,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GBRG = 52,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RGGB = 53,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BGGR = 54,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GRBG = 55,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GBRG = 56,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_RGGB = 57,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_BGGR = 58,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GRBG = 59,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GBRG = 60,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_RGGB = 61,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_BGGR = 62,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GRBG = 63,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GBRG = 64,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR = 65,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR = 66,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR = 67,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB = 68,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR = 69,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG = 70,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG = 71,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BCCR = 72,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RCCB = 73,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CRBC = 74,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CBRC = 75,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_CCCC = 76,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BCCR = 77,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RCCB = 78,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CRBC = 79,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CBRC = 80,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CCCC = 81,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y = 82,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 = 83,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 = 84,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 = 85,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 = 86,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 = 87,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 = 88,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 = 89,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 = 90,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 = 91,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = 92,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = 93,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR = 94,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 = 95,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_ER = 96,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_709_ER = 97,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_ER = 98,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_709_ER = 99,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_ER = 0x64,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_709_ER = 0x65,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA = 0x66,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV = 0x67,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU = 0x68,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY = 0x69,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER = 0x6A,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = 0x6B,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER = 0x6C,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = 0x6D,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER = 0x6E,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = 0x6F,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER = 0x70,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = 0x71,
  __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_MAX = 0x72
};

/* "cuda/ccuda.pxd":2692
 * 
 * 
 * cdef enum CUGLDeviceList_enum:             # <<<<<<<<<<<<<<
 *     CU_GL_DEVICE_LIST_ALL = 1
 *     CU_GL_DEVICE_LIST_CURRENT_FRAME = 2
 */
enum __pyx_t_4cuda_5ccuda_CUGLDeviceList_enum {
  __pyx_e_4cuda_5ccuda_CU_GL_DEVICE_LIST_ALL = 1,
  __pyx_e_4cuda_5ccuda_CU_GL_DEVICE_LIST_CURRENT_FRAME = 2,
  __pyx_e_4cuda_5ccuda_CU_GL_DEVICE_LIST_NEXT_FRAME = 3
};

/* "cuda/ccuda.pxd":2699
 * ctypedef CUGLDeviceList_enum CUGLDeviceList
 * 
 * cdef enum CUGLmap_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_GL_MAP_RESOURCE_FLAGS_NONE = 0
 *     CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 1
 */
enum __pyx_t_4cuda_5ccuda_CUGLmap_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_GL_MAP_RESOURCE_FLAGS_NONE = 0,
  __pyx_e_4cuda_5ccuda_CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 1,
  __pyx_e_4cuda_5ccuda_CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2
};

/* "cuda/ccuda.pxd":2712
 * cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) nogil except ?CUDA_ERROR_NOT_FOUND
 * 
 * cdef enum: CUDA_VERSION = 11080             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_VERSION = 0x2B48
};

/* "cuda/ccuda.pxd":2714
 * cdef enum: CUDA_VERSION = 11080
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_LEGACY = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_IPC_HANDLE_SIZE = 64
};

/* "cuda/ccuda.pxd":2716
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 * 
 * cdef enum: CU_STREAM_LEGACY = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_PER_THREAD = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_LEGACY = 1
};

/* "cuda/ccuda.pxd":2718
 * cdef enum: CU_STREAM_LEGACY = 1
 * 
 * cdef enum: CU_STREAM_PER_THREAD = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_PER_THREAD = 2
};

/* "cuda/ccuda.pxd":2720
 * cdef enum: CU_STREAM_PER_THREAD = 2
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
};

/* "cuda/ccuda.pxd":2722
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
};

/* "cuda/ccuda.pxd":2724
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4
};

/* "cuda/ccuda.pxd":2726
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5
};

/* "cuda/ccuda.pxd":2728
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8
};

/* "cuda/ccuda.pxd":2730
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
};

/* "cuda/ccuda.pxd":2732
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
};

/* "cuda/ccuda.pxd":2734
 * cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_PORTABLE = 1
};

/* "cuda/ccuda.pxd":2736
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1
 * 
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 4
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_DEVICEMAP = 2
};

/* "cuda/ccuda.pxd":2738
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2
 * 
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_WRITECOMBINED = 4
};

/* "cuda/ccuda.pxd":2740
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 4
 * 
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_PORTABLE = 1
};

/* "cuda/ccuda.pxd":2742
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 1
 * 
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 4
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_DEVICEMAP = 2
};

/* "cuda/ccuda.pxd":2744
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 2
 * 
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 8
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_IOMEMORY = 4
};

/* "cuda/ccuda.pxd":2746
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 4
 * 
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_READ_ONLY = 8
};

/* "cuda/ccuda.pxd":2748
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 8
 * 
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1
};

/* "cuda/ccuda.pxd":2750
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1
 * 
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_DEDICATED = 1
};

/* "cuda/ccuda.pxd":2752
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1
};

/* "cuda/ccuda.pxd":2754
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2
};

/* "cuda/ccuda.pxd":2756
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_NVSCISYNC_ATTR_SIGNAL = 1
};

/* "cuda/ccuda.pxd":2758
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 1
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_NVSCISYNC_ATTR_WAIT = 2
};

/* "cuda/ccuda.pxd":2760
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 2
 * 
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEM_CREATE_USAGE_TILE_POOL = 1
};

/* "cuda/ccuda.pxd":2762
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1
};

/* "cuda/ccuda.pxd":2764
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_LAYERED = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2
};

/* "cuda/ccuda.pxd":2766
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2
 * 
 * cdef enum: CUDA_ARRAY3D_LAYERED = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_LAYERED = 1
};

/* "cuda/ccuda.pxd":2768
 * cdef enum: CUDA_ARRAY3D_LAYERED = 1
 * 
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_2DARRAY = 1
};

/* "cuda/ccuda.pxd":2770
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 1
 * 
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 4
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_SURFACE_LDST = 2
};

/* "cuda/ccuda.pxd":2772
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 2
 * 
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 8
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_CUBEMAP = 4
};

/* "cuda/ccuda.pxd":2774
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 4
 * 
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 16
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_TEXTURE_GATHER = 8
};

/* "cuda/ccuda.pxd":2776
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 8
 * 
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 16             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 32
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_DEPTH_TEXTURE = 16
};

/* "cuda/ccuda.pxd":2778
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 16
 * 
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 32             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_SPARSE = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_COLOR_ATTACHMENT = 32
};

/* "cuda/ccuda.pxd":2780
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 32
 * 
 * cdef enum: CUDA_ARRAY3D_SPARSE = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_DEFERRED_MAPPING = 128
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_SPARSE = 64
};

/* "cuda/ccuda.pxd":2782
 * cdef enum: CUDA_ARRAY3D_SPARSE = 64
 * 
 * cdef enum: CUDA_ARRAY3D_DEFERRED_MAPPING = 128             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_DEFERRED_MAPPING = 0x80
};

/* "cuda/ccuda.pxd":2784
 * cdef enum: CUDA_ARRAY3D_DEFERRED_MAPPING = 128
 * 
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSA_OVERRIDE_FORMAT = 1
};

/* "cuda/ccuda.pxd":2786
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 1
 * 
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_READ_AS_INTEGER = 1
};

/* "cuda/ccuda.pxd":2788
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 1
 * 
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_SRGB = 16
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_NORMALIZED_COORDINATES = 2
};

/* "cuda/ccuda.pxd":2790
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 2
 * 
 * cdef enum: CU_TRSF_SRGB = 16             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_SRGB = 16
};

/* "cuda/ccuda.pxd":2792
 * cdef enum: CU_TRSF_SRGB = 16
 * 
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_SEAMLESS_CUBEMAP = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32
};

/* "cuda/ccuda.pxd":2794
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32
 * 
 * cdef enum: CU_TRSF_SEAMLESS_CUBEMAP = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_END_AS_INT = 0
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_SEAMLESS_CUBEMAP = 64
};

/* "cuda/ccuda.pxd":2796
 * cdef enum: CU_TRSF_SEAMLESS_CUBEMAP = 64
 * 
 * cdef enum: CU_LAUNCH_PARAM_END_AS_INT = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_END = 0
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_END_AS_INT = 0
};

/* "cuda/ccuda.pxd":2798
 * cdef enum: CU_LAUNCH_PARAM_END_AS_INT = 0
 * 
 * cdef enum: CU_LAUNCH_PARAM_END = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_END = 0
};

/* "cuda/ccuda.pxd":2800
 * cdef enum: CU_LAUNCH_PARAM_END = 0
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1
};

/* "cuda/ccuda.pxd":2802
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_POINTER = 1
};

/* "cuda/ccuda.pxd":2804
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 1
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2
};

/* "cuda/ccuda.pxd":2806
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_PARAM_TR_DEFAULT = -1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_SIZE = 2
};

/* "cuda/ccuda.pxd":2808
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 2
 * 
 * cdef enum: CU_PARAM_TR_DEFAULT = -1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_DEVICE_CPU = -1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_PARAM_TR_DEFAULT = -1L
};

/* "cuda/ccuda.pxd":2810
 * cdef enum: CU_PARAM_TR_DEFAULT = -1
 * 
 * cdef enum: CU_DEVICE_CPU = -1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_DEVICE_INVALID = -2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_CPU = -1L
};

/* "cuda/ccuda.pxd":2812
 * cdef enum: CU_DEVICE_CPU = -1
 * 
 * cdef enum: CU_DEVICE_INVALID = -2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_INVALID = -2L
};

/* "cuda/ccuda.pxd":2814
 * cdef enum: CU_DEVICE_INVALID = -2
 * 
 * cdef enum: MAX_PLANES = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295
 */
enum  {
  __pyx_e_4cuda_5ccuda_MAX_PLANES = 3
};

/* "cuda/ccuda.pxd":2816
 * cdef enum: MAX_PLANES = 3
 * 
 * cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295             # <<<<<<<<<<<<<<
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EGL_INFINITE_TIMEOUT = 0xFFFFFFFF
};

/* "cuda/ccuda.pxd":2480
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLImageKHR             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLImageKHR;

/* "cuda/ccuda.pxd":2485
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLStreamKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int EGLint
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLStreamKHR;

/* "cuda/ccuda.pxd":2492
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLSyncKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpDevice
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLSyncKHR;

/* "cuda/ccuda.pxd":2515
 *     CU_EGL_FRAME_TYPE_PITCH = 1
 * 
 * ctypedef CUeglFrameType_enum CUeglFrameType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUeglResourceLocationFlags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUeglFrameType_enum __pyx_t_4cuda_5ccuda_CUeglFrameType;

/* "cuda/ccuda.pxd":2521
 *     CU_EGL_RESOURCE_LOCATION_VIDMEM = 1
 * 
 * ctypedef CUeglResourceLocationFlags_enum CUeglResourceLocationFlags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUeglColorFormat_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUeglResourceLocationFlags_enum __pyx_t_4cuda_5ccuda_CUeglResourceLocationFlags;

/* "cuda/ccuda.pxd":2640
 *     CU_EGL_COLOR_FORMAT_MAX = 114
 * 
 * ctypedef CUeglColorFormat_enum CUeglColorFormat             # <<<<<<<<<<<<<<
 * 
 * cdef union _CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUeglColorFormat_enum __pyx_t_4cuda_5ccuda_CUeglColorFormat;

/* "cuda/ccuda.pxd":2642
 * ctypedef CUeglColorFormat_enum CUeglColorFormat
 * 
 * cdef union _CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u:             # <<<<<<<<<<<<<<
 *     CUarray pArray[3]
 *     void* pPitch[3]
 */
union __pyx_t_4cuda_5ccuda__CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u {
  CUarray pArray[3];
  void *pPitch[3];
};

/* "cuda/ccuda.pxd":2646
 *     void* pPitch[3]
 * 
 * cdef struct CUeglFrame_st:             # <<<<<<<<<<<<<<
 *     _CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u frame
 *     unsigned int width
 */
struct __pyx_t_4cuda_5ccuda_CUeglFrame_st {
  union __pyx_t_4cuda_5ccuda__CUeglFrame_v1_CUeglFrame_v1_CUeglFrame_st_frame_u frame;
  unsigned int width;
  unsigned int height;
  unsigned int depth;
  unsigned int pitch;
  unsigned int planeCount;
  unsigned int numChannels;
  __pyx_t_4cuda_5ccuda_CUeglFrameType frameType;
  __pyx_t_4cuda_5ccuda_CUeglColorFormat eglColorFormat;
  CUarray_format cuFormat;
};

/* "cuda/ccuda.pxd":2658
 *     CUarray_format cuFormat
 * 
 * ctypedef CUeglFrame_st CUeglFrame_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUeglFrame_v1 CUeglFrame
 */
typedef struct __pyx_t_4cuda_5ccuda_CUeglFrame_st __pyx_t_4cuda_5ccuda_CUeglFrame_v1;

/* "cuda/ccuda.pxd":2660
 * ctypedef CUeglFrame_st CUeglFrame_v1
 * 
 * ctypedef CUeglFrame_v1 CUeglFrame             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef __pyx_t_4cuda_5ccuda_CUeglFrame_v1 __pyx_t_4cuda_5ccuda_CUeglFrame;

/* "cuda/ccuda.pxd":2665
 *     cdef struct CUeglStreamConnection_st:
 *         pass
 * ctypedef CUeglStreamConnection_st* CUeglStreamConnection             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) nogil except ?CUDA_ERROR_NOT_FOUND
 */
typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_5ccuda_CUeglStreamConnection;

/* "cuda/ccuda.pxd":2697
 *     CU_GL_DEVICE_LIST_NEXT_FRAME = 3
 * 
 * ctypedef CUGLDeviceList_enum CUGLDeviceList             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUGLmap_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUGLDeviceList_enum __pyx_t_4cuda_5ccuda_CUGLDeviceList;

/* "cuda/ccuda.pxd":2704
 *     CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2
 * 
 * ctypedef CUGLmap_flags_enum CUGLmap_flags             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) nogil except ?CUDA_ERROR_NOT_FOUND
 */
typedef enum __pyx_t_4cuda_5ccuda_CUGLmap_flags_enum __pyx_t_4cuda_5ccuda_CUGLmap_flags;
struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st;
union __pyx_t_4cuda_7ccudart__cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u;
struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st;

/* "cuda/ccudart.pxd":1068
 * 
 * 
 * cdef enum cudaStreamAttrID:             # <<<<<<<<<<<<<<
 *     cudaStreamAttributeAccessPolicyWindow = 1
 *     cudaStreamAttributeSynchronizationPolicy = 3
 */
enum __pyx_t_4cuda_7ccudart_cudaStreamAttrID {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeAccessPolicyWindow = 1,
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeSynchronizationPolicy = 3
};

/* "cuda/ccudart.pxd":1072
 *     cudaStreamAttributeSynchronizationPolicy = 3
 * 
 * cdef enum cudaKernelNodeAttrID:             # <<<<<<<<<<<<<<
 *     cudaKernelNodeAttributeAccessPolicyWindow = 1
 *     cudaKernelNodeAttributeCooperative = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeAccessPolicyWindow = 1,
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeCooperative = 2,
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributePriority = 8
};

/* "cuda/ccudart.pxd":1113
 * ctypedef uint32_t VdpOutputSurface
 * 
 * cdef enum cudaGLDeviceList:             # <<<<<<<<<<<<<<
 *     cudaGLDeviceListAll = 1
 *     cudaGLDeviceListCurrentFrame = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaGLDeviceList {
  __pyx_e_4cuda_7ccudart_cudaGLDeviceListAll = 1,
  __pyx_e_4cuda_7ccudart_cudaGLDeviceListCurrentFrame = 2,
  __pyx_e_4cuda_7ccudart_cudaGLDeviceListNextFrame = 3
};

/* "cuda/ccudart.pxd":1118
 *     cudaGLDeviceListNextFrame = 3
 * 
 * cdef enum cudaGLMapFlags:             # <<<<<<<<<<<<<<
 *     cudaGLMapFlagsNone = 0
 *     cudaGLMapFlagsReadOnly = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaGLMapFlags {
  __pyx_e_4cuda_7ccudart_cudaGLMapFlagsNone = 0,
  __pyx_e_4cuda_7ccudart_cudaGLMapFlagsReadOnly = 1,
  __pyx_e_4cuda_7ccudart_cudaGLMapFlagsWriteDiscard = 2
};

/* "cuda/ccudart.pxd":1775
 * 
 * 
 * cdef enum cudaEglFrameType_enum:             # <<<<<<<<<<<<<<
 *     cudaEglFrameTypeArray = 0
 *     cudaEglFrameTypePitch = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaEglFrameType_enum {
  __pyx_e_4cuda_7ccudart_cudaEglFrameTypeArray = 0,
  __pyx_e_4cuda_7ccudart_cudaEglFrameTypePitch = 1
};

/* "cuda/ccudart.pxd":1781
 * ctypedef cudaEglFrameType_enum cudaEglFrameType
 * 
 * cdef enum cudaEglResourceLocationFlags_enum:             # <<<<<<<<<<<<<<
 *     cudaEglResourceLocationSysmem = 0
 *     cudaEglResourceLocationVidmem = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaEglResourceLocationFlags_enum {
  __pyx_e_4cuda_7ccudart_cudaEglResourceLocationSysmem = 0,
  __pyx_e_4cuda_7ccudart_cudaEglResourceLocationVidmem = 1
};

/* "cuda/ccudart.pxd":1787
 * ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags
 * 
 * cdef enum cudaEglColorFormat_enum:             # <<<<<<<<<<<<<<
 *     cudaEglColorFormatYUV420Planar = 0
 *     cudaEglColorFormatYUV420SemiPlanar = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaEglColorFormat_enum {
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar = 0,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar = 1,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar = 2,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar = 3,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatARGB = 6,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatRGBA = 7,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatL = 8,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatR = 9,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar = 10,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar = 11,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV422 = 12,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY422 = 13,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatABGR = 14,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBGRA = 15,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatA = 16,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatRG = 17,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV = 18,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar = 19,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar = 20,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar = 21,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar = 22,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar = 23,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar = 24,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar = 25,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY_ER = 26,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY_ER = 27,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV_ER = 28,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU_ER = 29,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA_ER = 31,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV_ER = 32,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar_ER = 33,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar_ER = 34,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_ER = 35,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar_ER = 36,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar_ER = 37,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_ER = 38,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar_ER = 39,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar_ER = 40,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_ER = 41,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar_ER = 42,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar_ER = 43,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_ER = 44,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRGGB = 45,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBGGR = 46,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGRBG = 47,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGBRG = 48,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10RGGB = 49,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10BGGR = 50,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GRBG = 51,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GBRG = 52,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RGGB = 53,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BGGR = 54,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GRBG = 55,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GBRG = 56,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14RGGB = 57,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14BGGR = 58,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GRBG = 59,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GBRG = 60,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20RGGB = 61,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20BGGR = 62,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GRBG = 63,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GBRG = 64,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar = 65,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar = 66,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar = 67,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspRGGB = 68,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspBGGR = 69,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGRBG = 70,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGBRG = 71,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBCCR = 72,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRCCB = 73,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCRBC = 74,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCBRC = 75,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10CCCC = 76,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BCCR = 77,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RCCB = 78,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CRBC = 79,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CBRC = 80,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CCCC = 81,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY = 82,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_2020 = 83,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_2020 = 84,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_2020 = 85,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_2020 = 86,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_709 = 87,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_709 = 88,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_709 = 89,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_709 = 90,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709 = 91,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_2020 = 92,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_2020 = 93,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar = 94,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_709 = 95,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_ER = 96,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_709_ER = 97,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_ER = 98,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_709_ER = 99,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_ER = 0x64,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_709_ER = 0x65,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA = 0x66,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU = 0x68,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY = 0x69,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_ER = 0x6A,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER = 0x6B,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_ER = 0x6C,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER = 0x6D,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_ER = 0x6E,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER = 0x6F,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_ER = 0x70,
  __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = 0x71
};

/* "cuda/ccudart.pxd":1954
 * cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver
 * 
 * cdef enum: cudaHostAllocDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocPortable = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocDefault = 0
};

/* "cuda/ccudart.pxd":1956
 * cdef enum: cudaHostAllocDefault = 0
 * 
 * cdef enum: cudaHostAllocPortable = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocMapped = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocPortable = 1
};

/* "cuda/ccudart.pxd":1958
 * cdef enum: cudaHostAllocPortable = 1
 * 
 * cdef enum: cudaHostAllocMapped = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocWriteCombined = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocMapped = 2
};

/* "cuda/ccudart.pxd":1960
 * cdef enum: cudaHostAllocMapped = 2
 * 
 * cdef enum: cudaHostAllocWriteCombined = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocWriteCombined = 4
};

/* "cuda/ccudart.pxd":1962
 * cdef enum: cudaHostAllocWriteCombined = 4
 * 
 * cdef enum: cudaHostRegisterDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterPortable = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterDefault = 0
};

/* "cuda/ccudart.pxd":1964
 * cdef enum: cudaHostRegisterDefault = 0
 * 
 * cdef enum: cudaHostRegisterPortable = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterMapped = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterPortable = 1
};

/* "cuda/ccudart.pxd":1966
 * cdef enum: cudaHostRegisterPortable = 1
 * 
 * cdef enum: cudaHostRegisterMapped = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterIoMemory = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterMapped = 2
};

/* "cuda/ccudart.pxd":1968
 * cdef enum: cudaHostRegisterMapped = 2
 * 
 * cdef enum: cudaHostRegisterIoMemory = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterReadOnly = 8
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterIoMemory = 4
};

/* "cuda/ccudart.pxd":1970
 * cdef enum: cudaHostRegisterIoMemory = 4
 * 
 * cdef enum: cudaHostRegisterReadOnly = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaPeerAccessDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterReadOnly = 8
};

/* "cuda/ccudart.pxd":1972
 * cdef enum: cudaHostRegisterReadOnly = 8
 * 
 * cdef enum: cudaPeerAccessDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaPeerAccessDefault = 0
};

/* "cuda/ccudart.pxd":1974
 * cdef enum: cudaPeerAccessDefault = 0
 * 
 * cdef enum: cudaStreamDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamNonBlocking = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamDefault = 0
};

/* "cuda/ccudart.pxd":1976
 * cdef enum: cudaStreamDefault = 0
 * 
 * cdef enum: cudaStreamNonBlocking = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamLegacy = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamNonBlocking = 1
};

/* "cuda/ccudart.pxd":1978
 * cdef enum: cudaStreamNonBlocking = 1
 * 
 * cdef enum: cudaStreamLegacy = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamPerThread = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamLegacy = 1
};

/* "cuda/ccudart.pxd":1980
 * cdef enum: cudaStreamLegacy = 1
 * 
 * cdef enum: cudaStreamPerThread = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamPerThread = 2
};

/* "cuda/ccudart.pxd":1982
 * cdef enum: cudaStreamPerThread = 2
 * 
 * cdef enum: cudaEventDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventBlockingSync = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventDefault = 0
};

/* "cuda/ccudart.pxd":1984
 * cdef enum: cudaEventDefault = 0
 * 
 * cdef enum: cudaEventBlockingSync = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventDisableTiming = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventBlockingSync = 1
};

/* "cuda/ccudart.pxd":1986
 * cdef enum: cudaEventBlockingSync = 1
 * 
 * cdef enum: cudaEventDisableTiming = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventInterprocess = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventDisableTiming = 2
};

/* "cuda/ccudart.pxd":1988
 * cdef enum: cudaEventDisableTiming = 2
 * 
 * cdef enum: cudaEventInterprocess = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventRecordDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventInterprocess = 4
};

/* "cuda/ccudart.pxd":1990
 * cdef enum: cudaEventInterprocess = 4
 * 
 * cdef enum: cudaEventRecordDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventRecordExternal = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventRecordDefault = 0
};

/* "cuda/ccudart.pxd":1992
 * cdef enum: cudaEventRecordDefault = 0
 * 
 * cdef enum: cudaEventRecordExternal = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventWaitDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventRecordExternal = 1
};

/* "cuda/ccudart.pxd":1994
 * cdef enum: cudaEventRecordExternal = 1
 * 
 * cdef enum: cudaEventWaitDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventWaitExternal = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventWaitDefault = 0
};

/* "cuda/ccudart.pxd":1996
 * cdef enum: cudaEventWaitDefault = 0
 * 
 * cdef enum: cudaEventWaitExternal = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleAuto = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventWaitExternal = 1
};

/* "cuda/ccudart.pxd":1998
 * cdef enum: cudaEventWaitExternal = 1
 * 
 * cdef enum: cudaDeviceScheduleAuto = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleSpin = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleAuto = 0
};

/* "cuda/ccudart.pxd":2000
 * cdef enum: cudaDeviceScheduleAuto = 0
 * 
 * cdef enum: cudaDeviceScheduleSpin = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleYield = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleSpin = 1
};

/* "cuda/ccudart.pxd":2002
 * cdef enum: cudaDeviceScheduleSpin = 1
 * 
 * cdef enum: cudaDeviceScheduleYield = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleBlockingSync = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleYield = 2
};

/* "cuda/ccudart.pxd":2004
 * cdef enum: cudaDeviceScheduleYield = 2
 * 
 * cdef enum: cudaDeviceScheduleBlockingSync = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceBlockingSync = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleBlockingSync = 4
};

/* "cuda/ccudart.pxd":2006
 * cdef enum: cudaDeviceScheduleBlockingSync = 4
 * 
 * cdef enum: cudaDeviceBlockingSync = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleMask = 7
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceBlockingSync = 4
};

/* "cuda/ccudart.pxd":2008
 * cdef enum: cudaDeviceBlockingSync = 4
 * 
 * cdef enum: cudaDeviceScheduleMask = 7             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceMapHost = 8
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleMask = 7
};

/* "cuda/ccudart.pxd":2010
 * cdef enum: cudaDeviceScheduleMask = 7
 * 
 * cdef enum: cudaDeviceMapHost = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceLmemResizeToMax = 16
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceMapHost = 8
};

/* "cuda/ccudart.pxd":2012
 * cdef enum: cudaDeviceMapHost = 8
 * 
 * cdef enum: cudaDeviceLmemResizeToMax = 16             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceMask = 31
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceLmemResizeToMax = 16
};

/* "cuda/ccudart.pxd":2014
 * cdef enum: cudaDeviceLmemResizeToMax = 16
 * 
 * cdef enum: cudaDeviceMask = 31             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceMask = 31
};

/* "cuda/ccudart.pxd":2016
 * cdef enum: cudaDeviceMask = 31
 * 
 * cdef enum: cudaArrayDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayLayered = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayDefault = 0
};

/* "cuda/ccudart.pxd":2018
 * cdef enum: cudaArrayDefault = 0
 * 
 * cdef enum: cudaArrayLayered = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySurfaceLoadStore = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayLayered = 1
};

/* "cuda/ccudart.pxd":2020
 * cdef enum: cudaArrayLayered = 1
 * 
 * cdef enum: cudaArraySurfaceLoadStore = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayCubemap = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySurfaceLoadStore = 2
};

/* "cuda/ccudart.pxd":2022
 * cdef enum: cudaArraySurfaceLoadStore = 2
 * 
 * cdef enum: cudaArrayCubemap = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayTextureGather = 8
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayCubemap = 4
};

/* "cuda/ccudart.pxd":2024
 * cdef enum: cudaArrayCubemap = 4
 * 
 * cdef enum: cudaArrayTextureGather = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayColorAttachment = 32
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayTextureGather = 8
};

/* "cuda/ccudart.pxd":2026
 * cdef enum: cudaArrayTextureGather = 8
 * 
 * cdef enum: cudaArrayColorAttachment = 32             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySparse = 64
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayColorAttachment = 32
};

/* "cuda/ccudart.pxd":2028
 * cdef enum: cudaArrayColorAttachment = 32
 * 
 * cdef enum: cudaArraySparse = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayDeferredMapping = 128
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySparse = 64
};

/* "cuda/ccudart.pxd":2030
 * cdef enum: cudaArraySparse = 64
 * 
 * cdef enum: cudaArrayDeferredMapping = 128             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayDeferredMapping = 0x80
};

/* "cuda/ccudart.pxd":2032
 * cdef enum: cudaArrayDeferredMapping = 128
 * 
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachGlobal = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaIpcMemLazyEnablePeerAccess = 1
};

/* "cuda/ccudart.pxd":2034
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 1
 * 
 * cdef enum: cudaMemAttachGlobal = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachHost = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachGlobal = 1
};

/* "cuda/ccudart.pxd":2036
 * cdef enum: cudaMemAttachGlobal = 1
 * 
 * cdef enum: cudaMemAttachHost = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachSingle = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachHost = 2
};

/* "cuda/ccudart.pxd":2038
 * cdef enum: cudaMemAttachHost = 2
 * 
 * cdef enum: cudaMemAttachSingle = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaOccupancyDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachSingle = 4
};

/* "cuda/ccudart.pxd":2040
 * cdef enum: cudaMemAttachSingle = 4
 * 
 * cdef enum: cudaOccupancyDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaOccupancyDisableCachingOverride = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaOccupancyDefault = 0
};

/* "cuda/ccudart.pxd":2042
 * cdef enum: cudaOccupancyDefault = 0
 * 
 * cdef enum: cudaOccupancyDisableCachingOverride = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaCpuDeviceId = -1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaOccupancyDisableCachingOverride = 1
};

/* "cuda/ccudart.pxd":2044
 * cdef enum: cudaOccupancyDisableCachingOverride = 1
 * 
 * cdef enum: cudaCpuDeviceId = -1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaInvalidDeviceId = -2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaCpuDeviceId = -1L
};

/* "cuda/ccudart.pxd":2046
 * cdef enum: cudaCpuDeviceId = -1
 * 
 * cdef enum: cudaInvalidDeviceId = -2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaInvalidDeviceId = -2L
};

/* "cuda/ccudart.pxd":2048
 * cdef enum: cudaInvalidDeviceId = -2
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaCooperativeLaunchMultiDeviceNoPreSync = 1
};

/* "cuda/ccudart.pxd":2050
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaCooperativeLaunchMultiDeviceNoPostSync = 2
};

/* "cuda/ccudart.pxd":2052
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2
 * 
 * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySparsePropertiesSingleMipTail = 1
};

/* "cuda/ccudart.pxd":2054
 * cdef enum: cudaArraySparsePropertiesSingleMipTail = 1
 * 
 * cdef enum: CUDA_IPC_HANDLE_SIZE = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalMemoryDedicated = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDA_IPC_HANDLE_SIZE = 64
};

/* "cuda/ccudart.pxd":2056
 * cdef enum: CUDA_IPC_HANDLE_SIZE = 64
 * 
 * cdef enum: cudaExternalMemoryDedicated = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryDedicated = 1
};

/* "cuda/ccudart.pxd":2058
 * cdef enum: cudaExternalMemoryDedicated = 1
 * 
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1
};

/* "cuda/ccudart.pxd":2060
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1
 * 
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaNvSciSyncAttrSignal = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2
};

/* "cuda/ccudart.pxd":2062
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2
 * 
 * cdef enum: cudaNvSciSyncAttrSignal = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaNvSciSyncAttrWait = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaNvSciSyncAttrSignal = 1
};

/* "cuda/ccudart.pxd":2064
 * cdef enum: cudaNvSciSyncAttrSignal = 1
 * 
 * cdef enum: cudaNvSciSyncAttrWait = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaNvSciSyncAttrWait = 2
};

/* "cuda/ccudart.pxd":2066
 * cdef enum: cudaNvSciSyncAttrWait = 2
 * 
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeClusterDimension = 4
};

/* "cuda/ccudart.pxd":2068
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4
 * 
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1D = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
};

/* "cuda/ccudart.pxd":2070
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
 * 
 * cdef enum: cudaSurfaceType1D = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2D = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1D = 1
};

/* "cuda/ccudart.pxd":2072
 * cdef enum: cudaSurfaceType1D = 1
 * 
 * cdef enum: cudaSurfaceType2D = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType3D = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType2D = 2
};

/* "cuda/ccudart.pxd":2074
 * cdef enum: cudaSurfaceType2D = 2
 * 
 * cdef enum: cudaSurfaceType3D = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceTypeCubemap = 12
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType3D = 3
};

/* "cuda/ccudart.pxd":2076
 * cdef enum: cudaSurfaceType3D = 3
 * 
 * cdef enum: cudaSurfaceTypeCubemap = 12             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1DLayered = 241
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceTypeCubemap = 12
};

/* "cuda/ccudart.pxd":2078
 * cdef enum: cudaSurfaceTypeCubemap = 12
 * 
 * cdef enum: cudaSurfaceType1DLayered = 241             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2DLayered = 242
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1DLayered = 0xF1
};

/* "cuda/ccudart.pxd":2080
 * cdef enum: cudaSurfaceType1DLayered = 241
 * 
 * cdef enum: cudaSurfaceType2DLayered = 242             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceTypeCubemapLayered = 252
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType2DLayered = 0xF2
};

/* "cuda/ccudart.pxd":2082
 * cdef enum: cudaSurfaceType2DLayered = 242
 * 
 * cdef enum: cudaSurfaceTypeCubemapLayered = 252             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType1D = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceTypeCubemapLayered = 0xFC
};

/* "cuda/ccudart.pxd":2084
 * cdef enum: cudaSurfaceTypeCubemapLayered = 252
 * 
 * cdef enum: cudaTextureType1D = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType2D = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType1D = 1
};

/* "cuda/ccudart.pxd":2086
 * cdef enum: cudaTextureType1D = 1
 * 
 * cdef enum: cudaTextureType2D = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType3D = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType2D = 2
};

/* "cuda/ccudart.pxd":2088
 * cdef enum: cudaTextureType2D = 2
 * 
 * cdef enum: cudaTextureType3D = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureTypeCubemap = 12
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType3D = 3
};

/* "cuda/ccudart.pxd":2090
 * cdef enum: cudaTextureType3D = 3
 * 
 * cdef enum: cudaTextureTypeCubemap = 12             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType1DLayered = 241
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureTypeCubemap = 12
};

/* "cuda/ccudart.pxd":2092
 * cdef enum: cudaTextureTypeCubemap = 12
 * 
 * cdef enum: cudaTextureType1DLayered = 241             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType2DLayered = 242
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType1DLayered = 0xF1
};

/* "cuda/ccudart.pxd":2094
 * cdef enum: cudaTextureType1DLayered = 241
 * 
 * cdef enum: cudaTextureType2DLayered = 242             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureTypeCubemapLayered = 252
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType2DLayered = 0xF2
};

/* "cuda/ccudart.pxd":2096
 * cdef enum: cudaTextureType2DLayered = 242
 * 
 * cdef enum: cudaTextureTypeCubemapLayered = 252             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDART_VERSION = 11080
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureTypeCubemapLayered = 0xFC
};

/* "cuda/ccudart.pxd":2098
 * cdef enum: cudaTextureTypeCubemapLayered = 252
 * 
 * cdef enum: CUDART_VERSION = 11080             # <<<<<<<<<<<<<<
 * 
 * cdef enum: __CUDART_API_VERSION = 11080
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDART_VERSION = 0x2B48
};

/* "cuda/ccudart.pxd":2100
 * cdef enum: CUDART_VERSION = 11080
 * 
 * cdef enum: __CUDART_API_VERSION = 11080             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EGL_MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart___CUDART_API_VERSION = 0x2B48
};

/* "cuda/ccudart.pxd":2102
 * cdef enum: __CUDART_API_VERSION = 11080
 * 
 * cdef enum: CUDA_EGL_MAX_PLANES = 3             # <<<<<<<<<<<<<<
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDA_EGL_MAX_PLANES = 3
};

/* "cuda/ccudart.pxd":1077
 *     cudaKernelNodeAttributePriority = 8
 * 
 * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue
 */
typedef union cudaLaunchAttributeValue __pyx_t_4cuda_7ccudart_cudaStreamAttrValue;

/* "cuda/ccudart.pxd":1079
 * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue
 * 
 * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue             # <<<<<<<<<<<<<<
 * 
 * from libc.stdint cimport uint32_t
 */
typedef union cudaLaunchAttributeValue __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue;

/* "cuda/ccudart.pxd":1091
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLImageKHR             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef void *__pyx_t_4cuda_7ccudart_EGLImageKHR;

/* "cuda/ccudart.pxd":1096
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLStreamKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int EGLint
 */
typedef void *__pyx_t_4cuda_7ccudart_EGLStreamKHR;

/* "cuda/ccudart.pxd":1103
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLSyncKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpDevice
 */
typedef void *__pyx_t_4cuda_7ccudart_EGLSyncKHR;

/* "cuda/ccudart.pxd":1779
 *     cudaEglFrameTypePitch = 1
 * 
 * ctypedef cudaEglFrameType_enum cudaEglFrameType             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaEglResourceLocationFlags_enum:
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaEglFrameType_enum __pyx_t_4cuda_7ccudart_cudaEglFrameType;

/* "cuda/ccudart.pxd":1785
 *     cudaEglResourceLocationVidmem = 1
 * 
 * ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaEglColorFormat_enum:
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaEglResourceLocationFlags_enum __pyx_t_4cuda_7ccudart_cudaEglResourceLocationFlags;

/* "cuda/ccudart.pxd":1899
 *     cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = 113
 * 
 * ctypedef cudaEglColorFormat_enum cudaEglColorFormat             # <<<<<<<<<<<<<<
 * 
 * cdef struct cudaEglPlaneDesc_st:
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaEglColorFormat_enum __pyx_t_4cuda_7ccudart_cudaEglColorFormat;

/* "cuda/ccudart.pxd":1901
 * ctypedef cudaEglColorFormat_enum cudaEglColorFormat
 * 
 * cdef struct cudaEglPlaneDesc_st:             # <<<<<<<<<<<<<<
 *     unsigned int width
 *     unsigned int height
 */
struct __pyx_t_4cuda_7ccudart_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/ccudart.pxd":1910
 *     unsigned int reserved[4]
 * 
 * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc             # <<<<<<<<<<<<<<
 * 
 * cdef union _cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u:
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc;

/* "cuda/ccudart.pxd":1912
 * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc
 * 
 * cdef union _cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u:             # <<<<<<<<<<<<<<
 *     cudaArray_t pArray[3]
 *     cudaPitchedPtr pPitch[3]
 */
union __pyx_t_4cuda_7ccudart__cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u {
  cudaArray_t pArray[3];
  struct cudaPitchedPtr pPitch[3];
};

/* "cuda/ccudart.pxd":1916
 *     cudaPitchedPtr pPitch[3]
 * 
 * cdef struct cudaEglFrame_st:             # <<<<<<<<<<<<<<
 *     _cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u frame
 *     cudaEglPlaneDesc planeDesc[3]
 */
struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st {
  union __pyx_t_4cuda_7ccudart__cudaEglFrame_cudaEglFrame_cudaEglFrame_st_frame_u frame;
  __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc planeDesc[3];
  unsigned int planeCount;
  __pyx_t_4cuda_7ccudart_cudaEglFrameType frameType;
  __pyx_t_4cuda_7ccudart_cudaEglColorFormat eglColorFormat;
};

/* "cuda/ccudart.pxd":1923
 *     cudaEglColorFormat eglColorFormat
 * 
 * ctypedef cudaEglFrame_st cudaEglFrame             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st __pyx_t_4cuda_7ccudart_cudaEglFrame;

/* "cuda/ccudart.pxd":1928
 *     cdef struct CUeglStreamConnection_st:
 *         pass
 * ctypedef CUeglStreamConnection_st* cudaEglStreamConnection             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver
 */
typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_7ccudart_cudaEglStreamConnection;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice;

/* "cuda/_lib/ccudart/utils.pxd":14
 * cimport cuda._cuda.ccuda as ccuda
 * 
 * cdef struct cudaPythonDevice:             # <<<<<<<<<<<<<<
 *     ccuda.CUdevice driverDevice
 *     ccuda.CUcontext primaryContext
 */
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice {
  CUdevice driverDevice;
  CUcontext primaryContext;
  bool primaryContextRetained;
  int deviceOrdinal;
  struct cudaDeviceProp deviceProperties;
};

/* "cuda/_lib/ccudart/utils.pxd":21
 *     cudaDeviceProp deviceProperties
 * 
 * cdef class cudaPythonGlobal:             # <<<<<<<<<<<<<<
 *     cdef bint _lazyInitDriver
 *     cdef int _numDevices
 */
struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal {
  PyObject_HEAD
  struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_vtab;
  int _lazyInitDriver;
  int _numDevices;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *_deviceList;
  cudaError_t _lastError;
  int _CUDART_VERSION;
};



struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal {
  cudaError_t (*lazyInitDriver)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *);
  cudaError_t (*lazyInitContextState)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDevice)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, int);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDeviceFromDriver)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUdevice);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDeviceFromPrimaryCtx)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUcontext);
};
static struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
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);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* Profile.proto */
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
  #define CYTHON_PROFILE 0
#else
  #define CYTHON_PROFILE 1
#endif
#endif
#ifndef CYTHON_TRACE_NOGIL
  #define CYTHON_TRACE_NOGIL 0
#else
  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
    #define CYTHON_TRACE 1
  #endif
#endif
#ifndef CYTHON_TRACE
  #define CYTHON_TRACE 0
#endif
#if CYTHON_TRACE
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL(frame)
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
  #endif
  #define __Pyx_TraceDeclarations\
      static PyCodeObject *__pyx_frame_code = NULL;\
      CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
      int __Pyx_use_tracing = 0;
  #define __Pyx_TraceFrameInit(codeobj)\
      if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
#if PY_VERSION_HEX >= 0x030b00a2
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
#elif PY_VERSION_HEX >= 0x030a00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                 || tstate->c_profilefunc != NULL);\
      } while (0)
#else
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                         || tstate->c_profilefunc != NULL);\
      } while (0)
#endif
  #ifdef WITH_THREAD
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  if (nogil) {\
      if (CYTHON_TRACE_NOGIL) {\
          PyThreadState *tstate;\
          PyGILState_STATE state = PyGILState_Ensure();\
          tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 1, 1)) {\
              __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          }\
          PyGILState_Release(state);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  } else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (__Pyx_IsTracing(tstate, 1, 1)) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #else
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  {   PyThreadState* tstate = PyThreadState_GET();\
      if (__Pyx_IsTracing(tstate, 1, 1)) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #endif
  #define __Pyx_TraceException()\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 1)) {\
          __Pyx_EnterTracing(tstate);\
          PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
          if (exc_info) {\
              if (CYTHON_TRACE && tstate->c_tracefunc)\
                  tstate->c_tracefunc(\
                      tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              tstate->c_profilefunc(\
                  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              Py_DECREF(exc_info);\
          }\
          __Pyx_LeaveTracing(tstate);\
      }\
  }
  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
      PyObject *type, *value, *traceback;
      __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
      __Pyx_EnterTracing(tstate);
      if (CYTHON_TRACE && tstate->c_tracefunc)
          tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
      if (tstate->c_profilefunc)
          tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
      CYTHON_FRAME_DEL(frame);
      __Pyx_LeaveTracing(tstate);
      __Pyx_ErrRestoreInState(tstate, type, value, traceback);
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0)) {\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0)) {\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
          }\
      }\
  }
  #else
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 0)) {\
          __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
      }\
  }
  #endif
  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
#else
  #define __Pyx_TraceDeclarations
  #define __Pyx_TraceFrameInit(codeobj)
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)   if ((1)); else goto_error;
  #define __Pyx_TraceException()
  #define __Pyx_TraceReturn(result, nogil)
#endif
#if CYTHON_TRACE
  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
      int ret;
      PyObject *type, *value, *traceback;
      __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
      __Pyx_PyFrame_SetLineNumber(frame, lineno);
      __Pyx_EnterTracing(tstate);
      ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
      __Pyx_LeaveTracing(tstate);
      if (likely(!ret)) {
          __Pyx_ErrRestoreInState(tstate, type, value, traceback);
      } else {
          Py_XDECREF(type);
          Py_XDECREF(value);
          Py_XDECREF(traceback);
      }
      return ret;
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              int ret = 0;\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
                  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              }\
              PyGILState_Release(state);\
              if (unlikely(ret)) goto_error;\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
              int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              if (unlikely(ret)) goto_error;\
          }\
      }\
  }
  #else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
          int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
          if (unlikely(ret)) goto_error;\
      }\
  }
  #endif
#else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)   if ((1)); else goto_error;
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
#if __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyObject *dict);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
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);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* None.proto */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* proto */

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(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);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* FunctionImport.proto */
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'libc.stdint' */

/* Module declarations from 'cuda.ccuda' */
static CUresult (*__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc)(CUDA_RESOURCE_DESC *, CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc)(CUDA_RESOURCE_VIEW_DESC *, CUtexObject); /*proto*/

/* Module declarations from 'cuda.ccudart' */
static cudaError_t (*__pyx_f_4cuda_7ccudart_cudaDeviceReset)(void); /*proto*/

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'libcpp' */

/* Module declarations from 'cuda._cuda.ccuda' */
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString)(CUresult, char const **); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion)(int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth)(size_t *, CUarray_format, unsigned int, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2)(CUdevice, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState)(CUdevice, unsigned int *, int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent)(CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent)(CUcontext *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice)(CUdevice *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags)(unsigned int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig)(CUsharedconfig); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId)(CUdevice *, char const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId)(char *, int, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties)(CUDA_ARRAY_SPARSE_PROPERTIES *, CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties)(CUDA_ARRAY_SPARSE_PROPERTIES *, CUmipmappedArray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements)(CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUarray, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements)(CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUmipmappedArray, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2)(CUDA_ARRAY3D_DESCRIPTOR *, CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess)(CUmemoryPool, CUmemAccessDesc const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise)(CUdeviceptr, size_t, CUmem_advise, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute)(void *, size_t, CUmem_range_attribute, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes)(void **, size_t *, CUmem_range_attribute *, size_t, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes)(unsigned int, CUpointer_attribute *, void **, CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate)(CUstream *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute)(CUstream, CUstreamAttrID, CUstreamAttrValue *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute)(CUstream, CUstreamAttrID, CUstreamAttrValue const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate)(CUevent *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery)(CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory)(CUexternalMemory *, CUDA_EXTERNAL_MEMORY_HANDLE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer)(CUdeviceptr *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_BUFFER_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray)(CUmipmappedArray *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore)(CUexternalSemaphore *, CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync)(CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync)(CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute)(int *, CUfunction_attribute, CUfunction); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams)(CUgraphNode, CUDA_KERNEL_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMCPY3D const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams)(CUgraphNode, CUDA_MEMCPY3D *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams)(CUgraphNode, CUDA_MEMCPY3D const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMSET_NODE_PARAMS const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams)(CUgraphNode, CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams)(CUgraphNode, CUdeviceptr *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_MEMCPY3D const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute)(CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute)(CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate)(CUtexObject *, CUDA_RESOURCE_DESC const *, CUDA_TEXTURE_DESC const *, CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc)(CUDA_RESOURCE_DESC *, CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc)(CUDA_TEXTURE_DESC *, CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate)(CUsurfObject *, CUDA_RESOURCE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc)(CUDA_RESOURCE_DESC *, CUsurfObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer)(int *, CUdevice, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess)(CUcontext, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess)(CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute)(int *, CUdevice_P2PAttribute, CUdevice, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress)(char const *, void **, int, cuuint64_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable)(void const **, CUuuid const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerInitialize)(char const *, char const *, CUoutput_mode); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame, CUstream *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame *, CUstream *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame)(__pyx_t_4cuda_5ccuda_CUeglFrame *, CUgraphicsResource, unsigned int, unsigned int); /*proto*/

/* Module declarations from 'cuda._lib.ccudart.utils' */
static PyTypeObject *__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = 0;
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext)(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext)(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *); /*proto*/
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *(*__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance)(void); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError)(cudaError_t); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo)(struct cudaChannelFormatDesc const *, int *, CUarray_format *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon)(cudaStream_t, cudaStreamCallback_t, void *, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon)(cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc)(struct cudaChannelFormatDesc *, size_t *, size_t *, size_t *, CUDA_ARRAY3D_DESCRIPTOR_v2 const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc)(cudaArray_const_t, struct cudaChannelFormatDesc *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc)(CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *, CUDA_TEXTURE_DESC *, struct cudaTextureDesc_v2 const *, CUDA_RESOURCE_VIEW_DESC *, struct cudaResourceViewDesc const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc)(struct cudaResourceDesc *, CUDA_RESOURCE_DESC const *, struct cudaTextureDesc_v2 *, CUDA_TEXTURE_DESC const *, struct cudaResourceViewDesc *, CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams)(void *, void const *, size_t, enum cudaMemcpyKind, struct cudaMemcpy3DParms *); /*proto*/
static void (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams)(struct cudaMemsetParams const *, CUDA_MEMSET_NODE_PARAMS *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams)(struct cudaMemcpy3DParms const *, CUDA_MEMCPY3D *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray)(cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, int, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray)(cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch)(void *, void const *, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost)(size_t, void **, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch)(size_t, size_t, size_t, void **, size_t *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray)(cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, unsigned int, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr)(char *, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D)(struct cudaMemcpy3DParms const *, bool, int, int, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch)(void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams)(CUDA_MEMCPY3D_v2 const *, struct cudaMemcpy3DParms *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray)(char *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray)(cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr)(struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray)(cudaArray_t, size_t, size_t, char const *, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray)(char *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray)(cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc)(CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame)(__pyx_t_4cuda_5ccuda_CUeglFrame *, __pyx_t_4cuda_7ccudart_cudaEglFrame); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame)(__pyx_t_4cuda_7ccudart_cudaEglFrame *, __pyx_t_4cuda_5ccuda_CUeglFrame); /*proto*/

/* Module declarations from 'cuda._lib.ccudart.ccudart' */
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global = 0;
#define __Pyx_MODULE_NAME "cuda._lib.ccudart.ccudart"
extern int __pyx_module_is_main_cuda___lib__ccudart__ccudart;
int __pyx_module_is_main_cuda___lib__ccudart__ccudart = 0;

/* Implementation of 'cuda._lib.ccudart.ccudart' */
static PyObject *__pyx_builtin_range;
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_range[] = "range";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_test;
/* Late includes */

/* "cuda/_lib/ccudart/ccudart.pyx":17
 * cdef cudaPythonGlobal m_global = globalGetInstance()
 * 
 * cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy(void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy", __pyx_f[0], 17, 1, __PYX_ERR(0, 17, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":20
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 20, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":21
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyDispatch(dst, src, count, kind)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":22
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyDispatch(dst, src, count, kind)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":21
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyDispatch(dst, src, count, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":23
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyDispatch(dst, src, count, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":24
 *         return err
 *     err = memcpyDispatch(dst, src, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":25
 *     err = memcpyDispatch(dst, src, count, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 25, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":24
 *         return err
 *     err = memcpyDispatch(dst, src, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":26
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":17
 * cdef cudaPythonGlobal m_global = globalGetInstance()
 * 
 * cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":29
 * 
 * 
 * cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreate(cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamCreate", __pyx_f[0], 29, 1, __PYX_ERR(0, 29, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":32
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 32, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":33
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":34
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":33
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":35
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate(__pyx_v_pStream, 0); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":36
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":37
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 37, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":36
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(pStream, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":38
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":29
 * 
 * 
 * cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamCreate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":41
 * 
 * 
 * cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreate(cudaEvent_t *__pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaEventCreate", __pyx_f[0], 41, 1, __PYX_ERR(0, 41, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":44
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 44, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":45
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":46
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":45
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":47
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate(__pyx_v_event, CU_EVENT_DEFAULT); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 47, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":48
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":49
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 49, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":48
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(event, ccuda.CUevent_flags_enum.CU_EVENT_DEFAULT)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":50
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":41
 * 
 * 
 * cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventCreate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":53
 * 
 * 
 * cdef cudaError_t _cudaEventQuery(cudaEvent_t event) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventQuery(cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaEventQuery", __pyx_f[0], 53, 1, __PYX_ERR(0, 53, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":55
 * cdef cudaError_t _cudaEventQuery(cudaEvent_t event) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery(((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 55, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":56
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":57
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 57, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":56
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":58
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":53
 * 
 * 
 * cdef cudaError_t _cudaEventQuery(cudaEvent_t event) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventQuery", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":61
 * 
 * 
 * cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaChannelFormatDesc desc
 *     desc.x = x
 */

static struct cudaChannelFormatDesc __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateChannelDesc(int __pyx_v_x, int __pyx_v_y, int __pyx_v_z, int __pyx_v_w, enum cudaChannelFormatKind __pyx_v_f) {
  struct cudaChannelFormatDesc __pyx_v_desc;
  struct cudaChannelFormatDesc __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateChannelDesc", __pyx_f[0], 61, 1, __PYX_ERR(0, 61, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":63
 * cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) nogil:
 *     cdef cudaChannelFormatDesc desc
 *     desc.x = x             # <<<<<<<<<<<<<<
 *     desc.y = y
 *     desc.z = z
 */
  __pyx_v_desc.x = __pyx_v_x;

  /* "cuda/_lib/ccudart/ccudart.pyx":64
 *     cdef cudaChannelFormatDesc desc
 *     desc.x = x
 *     desc.y = y             # <<<<<<<<<<<<<<
 *     desc.z = z
 *     desc.w = w
 */
  __pyx_v_desc.y = __pyx_v_y;

  /* "cuda/_lib/ccudart/ccudart.pyx":65
 *     desc.x = x
 *     desc.y = y
 *     desc.z = z             # <<<<<<<<<<<<<<
 *     desc.w = w
 *     desc.f = f
 */
  __pyx_v_desc.z = __pyx_v_z;

  /* "cuda/_lib/ccudart/ccudart.pyx":66
 *     desc.y = y
 *     desc.z = z
 *     desc.w = w             # <<<<<<<<<<<<<<
 *     desc.f = f
 *     return desc
 */
  __pyx_v_desc.w = __pyx_v_w;

  /* "cuda/_lib/ccudart/ccudart.pyx":67
 *     desc.z = z
 *     desc.w = w
 *     desc.f = f             # <<<<<<<<<<<<<<
 *     return desc
 * 
 */
  __pyx_v_desc.f = __pyx_v_f;

  /* "cuda/_lib/ccudart/ccudart.pyx":68
 *     desc.w = w
 *     desc.f = f
 *     return desc             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_desc;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":61
 * 
 * 
 * cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaChannelFormatDesc desc
 *     desc.x = x
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.ccudart._cudaCreateChannelDesc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":71
 * 
 * 
 * cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDriverGetVersion(int *__pyx_v_driverVersion) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDriverGetVersion", __pyx_f[0], 71, 1, __PYX_ERR(0, 71, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":73
 * cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion(__pyx_v_driverVersion); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":74
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":75
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 75, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":74
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":76
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":71
 * 
 * 
 * cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDriverGetVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":79
 * 
 * 
 * cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     runtimeVersion[0] = m_global._CUDART_VERSION
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaRuntimeGetVersion(int *__pyx_v_runtimeVersion) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaRuntimeGetVersion", __pyx_f[0], 79, 1, __PYX_ERR(0, 79, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":81
 * cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     runtimeVersion[0] = m_global._CUDART_VERSION             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_1 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_CUDART_VERSION;
  (__pyx_v_runtimeVersion[0]) = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":82
 *     cdef cudaError_t err
 *     runtimeVersion[0] = m_global._CUDART_VERSION
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":79
 * 
 * 
 * cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     runtimeVersion[0] = m_global._CUDART_VERSION
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaRuntimeGetVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":85
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetTexture1DLinearMaxWidth(size_t *__pyx_v_maxWidthInElements, struct cudaChannelFormatDesc const *__pyx_v_fmtDesc, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUarray_format __pyx_v_fmt;
  int __pyx_v_numChannels;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetTexture1DLinearMaxWidth", __pyx_f[0], 85, 1, __PYX_ERR(0, 85, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":86
 * 
 * cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if fmtDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_fmtDesc == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":87
 * cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 87, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":88
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":86
 * 
 * cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if fmtDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":92
 *     cdef cudaError_t err
 *     cdef ccuda.CUarray_format fmt
 *     cdef int numChannels = 0             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitDriver()
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":94
 *     cdef int numChannels = 0
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 94, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":95
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":96
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 *     if err == cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":95
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":97
 *     if err != cudaSuccess:
 *         return err
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo(__pyx_v_fmtDesc, (&__pyx_v_numChannels), (&__pyx_v_fmt)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 97, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":98
 *         return err
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err == cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":99
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 *     if err == cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 99, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":100
 *     if err == cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":98
 *         return err
 *     err = getDescInfo(fmtDesc, &numChannels, &fmt)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":101
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth(__pyx_v_maxWidthInElements, __pyx_v_fmt, ((unsigned int)__pyx_v_numChannels), __pyx_v_device); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 101, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":102
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":103
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 103, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":102
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmt, <unsigned>numChannels, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":104
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":85
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetTexture1DLinearMaxWidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":107
 * 
 * 
 * cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocHost(void **__pyx_v_ptr, size_t __pyx_v_size) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMallocHost", __pyx_f[0], 107, 1, __PYX_ERR(0, 107, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":108
 * 
 * cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if ptr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":109
 * cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 109, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":110
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":108
 * 
 * cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if ptr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":113
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 113, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":114
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocHost(size, ptr, 0)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":115
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocHost(size, ptr, 0)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":114
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocHost(size, ptr, 0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":116
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocHost(size, ptr, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost(__pyx_v_size, __pyx_v_ptr, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 116, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":117
 *         return err
 *     err = mallocHost(size, ptr, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":118
 *     err = mallocHost(size, ptr, 0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 118, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":117
 *         return err
 *     err = mallocHost(size, ptr, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":119
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":107
 * 
 * 
 * cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":122
 * 
 * 
 * cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if devPtr == NULL or pitch == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocPitch(void **__pyx_v_devPtr, size_t *__pyx_v_pitch, size_t __pyx_v_width, size_t __pyx_v_height) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMallocPitch", __pyx_f[0], 122, 1, __PYX_ERR(0, 122, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":123
 * 
 * cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if devPtr == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_devPtr == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_pitch == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":124
 * cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if devPtr == NULL or pitch == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":123
 * 
 * cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if devPtr == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":127
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 127, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":128
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":129
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":128
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":130
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocPitch(width, height, 1, devPtr, pitch)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch(__pyx_v_width, __pyx_v_height, 1, __pyx_v_devPtr, __pyx_v_pitch); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 130, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":131
 *         return err
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":132
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 132, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":131
 *         return err
 *     err = mallocPitch(width, height, 1, devPtr, pitch)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":133
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":122
 * 
 * 
 * cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if devPtr == NULL or pitch == NULL:
 *         return cudaErrorInvalidValue
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocPitch", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":136
 * 
 * 
 * cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if mipmappedArray == NULL or desc == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmappedArray, struct cudaChannelFormatDesc const *__pyx_v_desc, struct cudaExtent __pyx_v_extent, unsigned int __pyx_v_numLevels, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMallocMipmappedArray", __pyx_f[0], 136, 1, __PYX_ERR(0, 136, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":137
 * 
 * cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_mipmappedArray == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_desc == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":138
 * cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL or desc == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":137
 * 
 * cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":141
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":142
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":143
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":142
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":144
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray(__pyx_v_mipmappedArray, __pyx_v_desc, __pyx_v_extent.depth, __pyx_v_extent.height, __pyx_v_extent.width, __pyx_v_numLevels, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 144, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":145
 *         return err
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":146
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 146, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":145
 *         return err
 *     err = mallocMipmappedArray(mipmappedArray, desc, extent.depth, extent.height, extent.width, numLevels, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":147
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":136
 * 
 * 
 * cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if mipmappedArray == NULL or desc == NULL:
 *         return cudaErrorInvalidValue
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":150
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2D(void *__pyx_v_dst, size_t __pyx_v_dpitch, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2D", __pyx_f[0], 150, 1, __PYX_ERR(0, 150, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":153
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 153, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":154
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":155
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":154
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":156
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr(((char *)__pyx_v_dst), __pyx_v_dpitch, ((char const *)__pyx_v_src), __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 156, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":157
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":158
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 158, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":157
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":159
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":150
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":162
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DAsync(void *__pyx_v_dst, size_t __pyx_v_dpitch, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DAsync", __pyx_f[0], 162, 1, __PYX_ERR(0, 162, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":165
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 165, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":166
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":167
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":166
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":168
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr(((char *)__pyx_v_dst), __pyx_v_dpitch, ((char const *)__pyx_v_src), __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 168, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":169
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":170
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 170, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":169
 *         return err
 *     err = memcpy2DPtr(<char*>dst, dpitch, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":171
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":162
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":174
 * 
 * 
 * cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyAsync(void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyAsync", __pyx_f[0], 174, 1, __PYX_ERR(0, 174, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":177
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 177, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":178
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":179
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":178
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":180
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, __pyx_v_stream); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":181
 *         return err
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":182
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 182, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":181
 *         return err
 *     err = memcpyAsyncDispatch(dst, src, count, kind, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":183
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":174
 * 
 * 
 * cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":186
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaMemcpy3DParms const *__pyx_v_pCopyParams) {
  CUcontext __pyx_v_context;
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemcpyNode", __pyx_f[0], 186, 1, __PYX_ERR(0, 186, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":191
 *     cdef cudaError_t err
 * 
 *     if pCopyParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_pCopyParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":192
 * 
 *     if pCopyParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 192, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":193
 *     if pCopyParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":191
 *     cdef cudaError_t err
 * 
 *     if pCopyParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":195
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 195, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":196
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":197
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":196
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":199
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 199, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":200
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":201
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 201, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":202
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":200
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":204
 *         return err
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pCopyParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 204, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":205
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":206
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 206, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":207
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":205
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":209
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, (&__pyx_v_driverNodeParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 209, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":210
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":211
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 211, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":210
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":212
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":186
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemcpyNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":215
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode1D(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  CUcontext __pyx_v_context;
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct cudaMemcpy3DParms __pyx_v_copyParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemcpyNode1D", __pyx_f[0], 215, 1, __PYX_ERR(0, 215, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":221
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 221, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":222
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":223
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":222
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":225
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 225, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":226
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":227
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 227, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":228
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":226
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":230
 *         return err
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 230, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":232
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 232, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":233
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":234
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 234, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":235
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":233
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":237
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, (&__pyx_v_driverNodeParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 237, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":238
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":239
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 239, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":238
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":240
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":215
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemcpyNode1D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":243
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaMemcpy3DParms copyParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t __pyx_v_node, void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct cudaMemcpy3DParms __pyx_v_copyParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeSetParams1D", __pyx_f[0], 243, 1, __PYX_ERR(0, 243, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":248
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 248, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":249
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":250
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":249
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":251
 *     if err != cudaSuccess:
 *         return err
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 251, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":253
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 253, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":254
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":255
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 255, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":256
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":254
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":258
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams(__pyx_v_node, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 258, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":259
 * 
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":260
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 260, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":259
 * 
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":261
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":243
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaMemcpy3DParms copyParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemcpyNodeSetParams1D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":264
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, struct cudaMemcpy3DParms const *__pyx_v_pNodeParams) {
  CUcontext __pyx_v_context;
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemcpyNodeSetParams", __pyx_f[0], 264, 1, __PYX_ERR(0, 264, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":269
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_pNodeParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":270
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 270, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":271
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":269
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":273
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 273, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":274
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":275
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":274
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":277
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 277, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":278
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":279
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 279, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":280
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":278
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":282
 *         return err
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 282, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":283
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":284
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 284, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":285
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":283
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":287
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams(__pyx_v_hGraphExec, __pyx_v_node, (&__pyx_v_driverNodeParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 287, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":288
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":289
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 289, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":288
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":290
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":264
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecMemcpyNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":293
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  CUcontext __pyx_v_context;
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct cudaMemcpy3DParms __pyx_v_copyParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemcpyNodeSetParams1D", __pyx_f[0], 293, 1, __PYX_ERR(0, 293, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":299
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 299, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":300
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":301
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":300
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":303
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":304
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":305
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 305, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":306
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":304
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":308
 *         return err
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 308, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":310
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 310, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":311
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":312
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 312, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":313
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":311
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":315
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams(__pyx_v_hGraphExec, __pyx_v_node, (&__pyx_v_driverNodeParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 315, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":316
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":317
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 317, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":316
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemcpyNodeSetParams(hGraphExec, node, &driverNodeParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":318
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":293
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecMemcpyNodeSetParams1D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":321
 * 
 * 
 * cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDriverEntryPoint(char const *__pyx_v_symbol, void **__pyx_v_funcPtr, unsigned PY_LONG_LONG __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDriverEntryPoint", __pyx_f[0], 321, 1, __PYX_ERR(0, 321, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":323
 * cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress(__pyx_v_symbol, __pyx_v_funcPtr, __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_CUDART_VERSION, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 323, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":324
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":325
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 325, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":324
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":326
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":321
 * 
 * 
 * cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global._CUDART_VERSION, flags)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDriverEntryPoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":329
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemsetNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaMemsetParams const *__pyx_v_pMemsetParams) {
  CUcontext __pyx_v_context;
  CUDA_MEMSET_NODE_PARAMS __pyx_v_driverParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemsetNode", __pyx_f[0], 329, 1, __PYX_ERR(0, 329, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":334
 *     cdef cudaError_t err
 * 
 *     if pMemsetParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_pMemsetParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":335
 * 
 *     if pMemsetParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 335, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":336
 *     if pMemsetParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":334
 *     cdef cudaError_t err
 * 
 *     if pMemsetParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":338
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 338, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":339
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":340
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":339
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":342
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 342, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":343
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":344
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 344, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":345
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     toDriverMemsetNodeParams(pMemsetParams, &driverParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":343
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":347
 *         return err
 * 
 *     toDriverMemsetNodeParams(pMemsetParams, &driverParams)             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams(__pyx_v_pMemsetParams, (&__pyx_v_driverParams));

  /* "cuda/_lib/ccudart/ccudart.pyx":349
 *     toDriverMemsetNodeParams(pMemsetParams, &driverParams)
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, (&__pyx_v_driverParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 349, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":350
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":351
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 351, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":350
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":352
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":329
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemsetNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":355
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, struct cudaMemsetParams const *__pyx_v_pNodeParams) {
  CUcontext __pyx_v_context;
  CUDA_MEMSET_NODE_PARAMS __pyx_v_driverParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemsetNodeSetParams", __pyx_f[0], 355, 1, __PYX_ERR(0, 355, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":360
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_pNodeParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":361
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 361, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":362
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":360
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":364
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 364, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":365
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":366
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":365
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":368
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 368, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":369
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":370
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 370, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":371
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     toDriverMemsetNodeParams(pNodeParams, &driverParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":369
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":373
 *         return err
 * 
 *     toDriverMemsetNodeParams(pNodeParams, &driverParams)             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverParams));

  /* "cuda/_lib/ccudart/ccudart.pyx":375
 *     toDriverMemsetNodeParams(pNodeParams, &driverParams)
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams(__pyx_v_hGraphExec, __pyx_v_node, (&__pyx_v_driverParams), __pyx_v_context); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 375, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":376
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":377
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 377, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":376
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":378
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":355
 * 
 * 
 * cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecMemsetNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":381
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaError_t err
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemcpy3DParms const *__pyx_v_pNodeParams) {
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeSetParams", __pyx_f[0], 381, 1, __PYX_ERR(0, 381, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":385
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_pNodeParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":386
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 386, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":387
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":385
 *     cdef cudaError_t err
 * 
 *     if pNodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":389
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 389, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":390
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":391
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":390
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":392
 *     if err != cudaSuccess:
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 392, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":393
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":394
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 394, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":395
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":393
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":396
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams(__pyx_v_node, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 396, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":397
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":398
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 398, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":397
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":399
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":381
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaError_t err
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemcpyNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":402
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemcpy3DParms *__pyx_v_p) {
  CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeGetParams", __pyx_f[0], 402, 1, __PYX_ERR(0, 402, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":405
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 * 
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":406
 * 
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 406, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":407
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":405
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 * 
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":410
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 410, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":411
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":412
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":411
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":413
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams(__pyx_v_node, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 413, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":414
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":415
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 415, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":416
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":414
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":417
 *         _setLastError(err)
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams((&__pyx_v_driverNodeParams), __pyx_v_p); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 417, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":418
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":419
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 419, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":418
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":420
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":402
 * 
 * 
 * cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemcpyNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":423
 * 
 * 
 * cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncGetAttributes(struct cudaFuncAttributes *__pyx_v_attr, void const *__pyx_v_func) {
  cudaError_t __pyx_v_err;
  int __pyx_v_bytes;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaFuncGetAttributes", __pyx_f[0], 423, 1, __PYX_ERR(0, 423, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":425
 * cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 425, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":426
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if NULL == attr:
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":427
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if NULL == attr:
 *         _setLastError(cudaErrorInvalidValue)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":426
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if NULL == attr:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":428
 *     if err != cudaSuccess:
 *         return err
 *     if NULL == attr:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((NULL == __pyx_v_attr) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":429
 *         return err
 *     if NULL == attr:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef int bytes
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 429, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":430
 *     if NULL == attr:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef int bytes
 *     memset(attr, 0, sizeof(cudaFuncAttributes))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":428
 *     if err != cudaSuccess:
 *         return err
 *     if NULL == attr:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":432
 *         return cudaErrorInvalidValue
 *     cdef int bytes
 *     memset(attr, 0, sizeof(cudaFuncAttributes))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].maxThreadsPerBlock,     ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
  (void)(memset(__pyx_v_attr, 0, (sizeof(struct cudaFuncAttributes))));

  /* "cuda/_lib/ccudart/ccudart.pyx":433
 *     cdef int bytes
 *     memset(attr, 0, sizeof(cudaFuncAttributes))
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].maxThreadsPerBlock,     ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).maxThreadsPerBlock), CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 433, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":434
 *     memset(attr, 0, sizeof(cudaFuncAttributes))
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].maxThreadsPerBlock,     ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":435
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].maxThreadsPerBlock,     ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 435, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":436
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":434
 *     memset(attr, 0, sizeof(cudaFuncAttributes))
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].maxThreadsPerBlock,     ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":437
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).numRegs), CU_FUNC_ATTRIBUTE_NUM_REGS, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 437, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":438
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":439
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 439, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":440
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":438
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].numRegs,                ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":441
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).ptxVersion), CU_FUNC_ATTRIBUTE_PTX_VERSION, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 441, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":442
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":443
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 443, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":444
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":442
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].ptxVersion,             ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":445
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).binaryVersion), CU_FUNC_ATTRIBUTE_BINARY_VERSION, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 445, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":446
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":447
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 447, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":448
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":446
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].binaryVersion,          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":449
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 449, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":450
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":451
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     attr[0].sharedSizeBytes = <size_t>bytes
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 451, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":452
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     attr[0].sharedSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":450
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":453
 *         _setLastError(err)
 *         return err
 *     attr[0].sharedSizeBytes = <size_t>bytes             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
  (__pyx_v_attr[0]).sharedSizeBytes = ((size_t)__pyx_v_bytes);

  /* "cuda/_lib/ccudart/ccudart.pyx":454
 *         return err
 *     attr[0].sharedSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 454, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":455
 *     attr[0].sharedSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":456
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     attr[0].constSizeBytes = <size_t>bytes
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 456, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":457
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     attr[0].constSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":455
 *     attr[0].sharedSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":458
 *         _setLastError(err)
 *         return err
 *     attr[0].constSizeBytes = <size_t>bytes             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
  (__pyx_v_attr[0]).constSizeBytes = ((size_t)__pyx_v_bytes);

  /* "cuda/_lib/ccudart/ccudart.pyx":459
 *         return err
 *     attr[0].constSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 459, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":460
 *     attr[0].constSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":461
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     attr[0].localSizeBytes = <size_t>bytes
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 461, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":462
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     attr[0].localSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":460
 *     attr[0].constSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":463
 *         _setLastError(err)
 *         return err
 *     attr[0].localSizeBytes = <size_t>bytes             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
  (__pyx_v_attr[0]).localSizeBytes = ((size_t)__pyx_v_bytes);

  /* "cuda/_lib/ccudart/ccudart.pyx":464
 *         return err
 *     attr[0].localSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).cacheModeCA), CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 464, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":465
 *     attr[0].localSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":466
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 466, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":467
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":465
 *     attr[0].localSizeBytes = <size_t>bytes
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].cacheModeCA,            ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":468
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":469
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":470
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 470, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":471
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":469
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&bytes,                          ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":472
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).preferredShmemCarveout), CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, ((CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 472, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":473
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":474
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 474, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":475
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":473
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncGetAttribute(&attr[0].preferredShmemCarveout, ccuda.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, <ccuda.CUfunction>func)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":476
 *         _setLastError(err)
 *         return err
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  (__pyx_v_attr[0]).maxDynamicSharedSizeBytes = ((size_t)__pyx_v_bytes);

  /* "cuda/_lib/ccudart/ccudart.pyx":477
 *         return err
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":478
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 478, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":477
 *         return err
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":479
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":423
 * 
 * 
 * cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFuncGetAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":482
 * 
 * 
 * cdef cudaError_t _cudaMallocArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocArray(cudaArray_t *__pyx_v_arrayPtr, struct cudaChannelFormatDesc const *__pyx_v_desc, size_t __pyx_v_width, size_t __pyx_v_height, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMallocArray", __pyx_f[0], 482, 1, __PYX_ERR(0, 482, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":483
 * 
 * cdef cudaError_t _cudaMallocArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_arrayPtr == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_desc == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":484
 * cdef cudaError_t _cudaMallocArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 484, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":485
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":483
 * 
 * cdef cudaError_t _cudaMallocArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":487
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 487, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":488
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":489
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":488
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":490
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray(__pyx_v_arrayPtr, __pyx_v_desc, 0, __pyx_v_height, __pyx_v_width, 0, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 490, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":491
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":492
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 492, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":491
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":493
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":482
 * 
 * 
 * cdef cudaError_t _cudaMallocArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":496
 * 
 * 
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if pitchedDevPtr == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3D(struct cudaPitchedPtr *__pyx_v_pitchedDevPtr, struct cudaExtent __pyx_v_extent) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMalloc3D", __pyx_f[0], 496, 1, __PYX_ERR(0, 496, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":497
 * 
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if pitchedDevPtr == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_pitchedDevPtr == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":498
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if pitchedDevPtr == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":497
 * 
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if pitchedDevPtr == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":501
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 501, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":502
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":503
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":502
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":504
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch(__pyx_v_extent.width, __pyx_v_extent.height, __pyx_v_extent.depth, (&(__pyx_v_pitchedDevPtr[0]).ptr), (&(__pyx_v_pitchedDevPtr[0]).pitch)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 504, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":505
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":506
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     pitchedDevPtr[0].xsize = extent.width
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 506, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":507
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     pitchedDevPtr[0].xsize = extent.width
 *     pitchedDevPtr[0].ysize = extent.height
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":505
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":508
 *         _setLastError(err)
 *         return err
 *     pitchedDevPtr[0].xsize = extent.width             # <<<<<<<<<<<<<<
 *     pitchedDevPtr[0].ysize = extent.height
 *     return err
 */
  __pyx_t_3 = __pyx_v_extent.width;
  (__pyx_v_pitchedDevPtr[0]).xsize = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":509
 *         return err
 *     pitchedDevPtr[0].xsize = extent.width
 *     pitchedDevPtr[0].ysize = extent.height             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
  __pyx_t_3 = __pyx_v_extent.height;
  (__pyx_v_pitchedDevPtr[0]).ysize = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":510
 *     pitchedDevPtr[0].xsize = extent.width
 *     pitchedDevPtr[0].ysize = extent.height
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":496
 * 
 * 
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if pitchedDevPtr == NULL:
 *         return cudaErrorInvalidValue
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMalloc3D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":513
 * 
 * 
 * cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3DArray(cudaArray_t *__pyx_v_arrayPtr, struct cudaChannelFormatDesc const *__pyx_v_desc, struct cudaExtent __pyx_v_extent, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMalloc3DArray", __pyx_f[0], 513, 1, __PYX_ERR(0, 513, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":514
 * 
 * cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_arrayPtr == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_desc == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":515
 * cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 515, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":516
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":514
 * 
 * cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":519
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 519, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":520
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":521
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":520
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":522
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray(__pyx_v_arrayPtr, __pyx_v_desc, __pyx_v_extent.depth, __pyx_v_extent.height, __pyx_v_extent.width, 0, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 522, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":523
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":524
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 524, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":523
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":525
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":513
 * 
 * 
 * cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* arrayPtr, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if arrayPtr == NULL or desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMalloc3DArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":528
 * 
 * 
 * cdef const char* _cudaGetErrorString(cudaError_t error) nogil except ?NULL:             # <<<<<<<<<<<<<<
 *     cdef const char* pStr = NULL
 *     cdef cudaError_t err
 */

static char const *__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetErrorString(cudaError_t __pyx_v_error) {
  char const *__pyx_v_pStr;
  cudaError_t __pyx_v_err;
  char const *__pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetErrorString", __pyx_f[0], 528, 1, __PYX_ERR(0, 528, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":529
 * 
 * cdef const char* _cudaGetErrorString(cudaError_t error) nogil except ?NULL:
 *     cdef const char* pStr = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */
  __pyx_v_pStr = NULL;

  /* "cuda/_lib/ccudart/ccudart.pyx":532
 *     cdef cudaError_t err
 * 
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString(((CUresult)__pyx_v_error), (&__pyx_v_pStr)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 532, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":533
 * 
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":534
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 *         pStr = "unrecognized error code"
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 534, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":533
 * 
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":535
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:             # <<<<<<<<<<<<<<
 *         pStr = "unrecognized error code"
 *     return pStr
 */
  __pyx_t_2 = ((__pyx_v_err == ((cudaError_t)cudaErrorInvalidValue)) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":536
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 *         pStr = "unrecognized error code"             # <<<<<<<<<<<<<<
 *     return pStr
 * 
 */
    __pyx_v_pStr = ((char const *)"unrecognized error code");

    /* "cuda/_lib/ccudart/ccudart.pyx":535
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:             # <<<<<<<<<<<<<<
 *         pStr = "unrecognized error code"
 *     return pStr
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":537
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 *         pStr = "unrecognized error code"
 *     return pStr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_pStr;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":528
 * 
 * 
 * cdef const char* _cudaGetErrorString(cudaError_t error) nogil except ?NULL:             # <<<<<<<<<<<<<<
 *     cdef const char* pStr = NULL
 *     cdef cudaError_t err
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetErrorString", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":540
 * 
 * 
 * cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAddCallback(cudaStream_t __pyx_v_stream, cudaStreamCallback_t __pyx_v_callback, void *__pyx_v_userData, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamAddCallback", __pyx_f[0], 540, 1, __PYX_ERR(0, 540, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":543
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":544
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":545
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":544
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":546
 *     if err != cudaSuccess:
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon(__pyx_v_stream, __pyx_v_callback, __pyx_v_userData, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 546, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":547
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":548
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 548, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":547
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":549
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":540
 * 
 * 
 * cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamAddCallback", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":552
 * 
 * 
 * cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo(cudaStream_t __pyx_v_stream, enum cudaStreamCaptureStatus *__pyx_v_captureStatus_out, unsigned PY_LONG_LONG *__pyx_v_id_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamGetCaptureInfo", __pyx_f[0], 552, 1, __PYX_ERR(0, 552, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":555
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 555, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":556
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":557
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":556
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":558
 *     if err != cudaSuccess:
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon(__pyx_v_stream, __pyx_v_captureStatus_out, __pyx_v_id_out, ((cudaGraph_t *)0), ((cudaGraphNode_t const **)0), ((size_t *)0)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 558, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":559
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":560
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 560, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":559
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, <cudaGraph_t *>0, <const cudaGraphNode_t **>0, <size_t *>0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":561
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":552
 * 
 * 
 * cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetCaptureInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":564
 * 
 * 
 * cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo_v2(cudaStream_t __pyx_v_stream, enum cudaStreamCaptureStatus *__pyx_v_captureStatus_out, unsigned PY_LONG_LONG *__pyx_v_id_out, cudaGraph_t *__pyx_v_graph_out, cudaGraphNode_t const **__pyx_v_dependencies_out, size_t *__pyx_v_numDependencies_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamGetCaptureInfo_v2", __pyx_f[0], 564, 1, __PYX_ERR(0, 564, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":567
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 567, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":568
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":569
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":568
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":570
 *     if err != cudaSuccess:
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon(__pyx_v_stream, __pyx_v_captureStatus_out, __pyx_v_id_out, __pyx_v_graph_out, __pyx_v_dependencies_out, __pyx_v_numDependencies_out); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 570, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":571
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":572
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 572, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":571
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":573
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":564
 * 
 * 
 * cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetCaptureInfo_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":576
 * 
 * 
 * cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalSemaphore(cudaExternalSemaphore_t *__pyx_v_extSem_out, struct cudaExternalSemaphoreHandleDesc const *__pyx_v_semHandleDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC __pyx_v_driverSemHandleDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_t_3;
  void *__pyx_t_4;
  void const *__pyx_t_5;
  void const *__pyx_t_6;
  unsigned int __pyx_t_7;
  CUresult __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaImportExternalSemaphore", __pyx_f[0], 576, 1, __PYX_ERR(0, 576, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":580
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 *     if semHandleDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_semHandleDesc == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":581
 * 
 *     if semHandleDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 581, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":582
 *     if semHandleDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":580
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 *     if semHandleDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":584
 *         return cudaErrorInvalidValue
 * 
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))             # <<<<<<<<<<<<<<
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:
 */
  (void)(memset((&__pyx_v_driverSemHandleDesc), 0, (sizeof(__pyx_v_driverSemHandleDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":586
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
  switch (__pyx_v_semHandleDesc->type) {
    case cudaExternalSemaphoreHandleTypeOpaqueFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":587
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":588
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 */
    __pyx_t_3 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":586
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
    break;
    case cudaExternalSemaphoreHandleTypeOpaqueWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":590
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":591
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":592
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":589
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":594
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":595
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":596
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":593
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeD3D12Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":598
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":599
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":600
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":597
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeD3D11Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":602
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":603
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":604
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":601
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeNvSciSync:

    /* "cuda/_lib/ccudart/ccudart.pyx":606
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC;

    /* "cuda/_lib/ccudart/ccudart.pyx":607
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 */
    __pyx_t_6 = __pyx_v_semHandleDesc->handle.nvSciSyncObj;
    __pyx_v_driverSemHandleDesc.handle.nvSciSyncObj = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":605
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 */
    break;
    case cudaExternalSemaphoreHandleTypeKeyedMutex:

    /* "cuda/_lib/ccudart/ccudart.pyx":609
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX;

    /* "cuda/_lib/ccudart/ccudart.pyx":610
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":611
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":608
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeKeyedMutexKmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":613
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":614
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":615
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":612
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":617
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":618
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 */
    __pyx_t_3 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":616
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
    break;
    case cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":620
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":621
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":622
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 * 
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":619
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":623
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     driverSemHandleDesc.flags = semHandleDesc.flags             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_t_7 = __pyx_v_semHandleDesc->flags;
  __pyx_v_driverSemHandleDesc.flags = __pyx_t_7;

  /* "cuda/_lib/ccudart/ccudart.pyx":625
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 625, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":626
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":627
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":626
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":628
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_8 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore(((CUexternalSemaphore *)__pyx_v_extSem_out), (&__pyx_v_driverSemHandleDesc)); if (unlikely(__pyx_t_8 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 628, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_8);

  /* "cuda/_lib/ccudart/ccudart.pyx":629
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != ((cudaError_t)cudaSuccess)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":630
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 630, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":629
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":631
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":576
 * 
 * 
 * cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaImportExternalSemaphore", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":634
 * 
 * 
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync(cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct cudaExternalSemaphoreSignalParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSignalExternalSemaphoresAsync", __pyx_f[0], 634, 1, __PYX_ERR(0, 634, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":636
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 636, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":637
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":638
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":637
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":639
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync(((CUexternalSemaphore const *)__pyx_v_extSemArray), ((CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 639, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":640
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":641
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 641, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":642
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":640
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":643
 *         _setLastError(err)
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":634
 * 
 * 
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSignalExternalSemaphoresAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":646
 * 
 * 
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync(cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct cudaExternalSemaphoreWaitParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaWaitExternalSemaphoresAsync", __pyx_f[0], 646, 1, __PYX_ERR(0, 646, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":648
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 648, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":649
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":650
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":649
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":651
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync(((CUexternalSemaphore const *)__pyx_v_extSemArray), ((CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 651, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":652
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":653
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 653, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":654
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":652
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":655
 *         _setLastError(err)
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":646
 * 
 * 
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaWaitExternalSemaphoresAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":658
 * 
 * 
 * cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo(struct cudaChannelFormatDesc *__pyx_v_desc, struct cudaExtent *__pyx_v_extent, unsigned int *__pyx_v_flags, cudaArray_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_driverDesc;
  size_t __pyx_v_width;
  size_t __pyx_v_height;
  size_t __pyx_v_depth;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  unsigned int __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaArrayGetInfo", __pyx_f[0], 658, 1, __PYX_ERR(0, 658, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":661
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     cdef size_t width  = 0             # <<<<<<<<<<<<<<
 *     cdef size_t height = 0
 *     cdef size_t depth  = 0
 */
  __pyx_v_width = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":662
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     cdef size_t width  = 0
 *     cdef size_t height = 0             # <<<<<<<<<<<<<<
 *     cdef size_t depth  = 0
 * 
 */
  __pyx_v_height = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":663
 *     cdef size_t width  = 0
 *     cdef size_t height = 0
 *     cdef size_t depth  = 0             # <<<<<<<<<<<<<<
 * 
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 */
  __pyx_v_depth = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":666
 * 
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = 0
 * 
 */
  __pyx_t_1 = (__pyx_v_flags != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":667
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:
 *         flags[0] = 0             # <<<<<<<<<<<<<<
 * 
 *     if desc:
 */
    (__pyx_v_flags[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":666
 * 
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = 0
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":669
 *         flags[0] = 0
 * 
 *     if desc:             # <<<<<<<<<<<<<<
 *         memset(desc, 0, sizeof(desc[0]))
 * 
 */
  __pyx_t_1 = (__pyx_v_desc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":670
 * 
 *     if desc:
 *         memset(desc, 0, sizeof(desc[0]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (void)(memset(__pyx_v_desc, 0, (sizeof((__pyx_v_desc[0])))));

    /* "cuda/_lib/ccudart/ccudart.pyx":669
 *         flags[0] = 0
 * 
 *     if desc:             # <<<<<<<<<<<<<<
 *         memset(desc, 0, sizeof(desc[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":673
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  __pyx_t_1 = (__pyx_v_extent != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":674
 * 
 *     if extent:
 *         memset(extent, 0, sizeof(extent[0]))             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 */
    (void)(memset(__pyx_v_extent, 0, (sizeof((__pyx_v_extent[0])))));

    /* "cuda/_lib/ccudart/ccudart.pyx":673
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":676
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2((&__pyx_v_driverDesc), ((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":677
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != ((cudaError_t)cudaSuccess)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":678
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 678, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":679
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     # Flags are copied directly from the driver API
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":677
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":682
 * 
 *     # Flags are copied directly from the driver API
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = driverDesc.Flags
 * 
 */
  __pyx_t_1 = (__pyx_v_flags != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":683
 *     # Flags are copied directly from the driver API
 *     if flags:
 *         flags[0] = driverDesc.Flags             # <<<<<<<<<<<<<<
 * 
 *     # Convert from driver API types to runtime API types. extent.Depth = 0
 */
    __pyx_t_4 = __pyx_v_driverDesc.Flags;
    (__pyx_v_flags[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":682
 * 
 *     # Flags are copied directly from the driver API
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = driverDesc.Flags
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":687
 *     # Convert from driver API types to runtime API types. extent.Depth = 0
 *     # indicates a 2D array.
 *     if desc:             # <<<<<<<<<<<<<<
 *         width  = 0
 *         height = 0
 */
  __pyx_t_1 = (__pyx_v_desc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":688
 *     # indicates a 2D array.
 *     if desc:
 *         width  = 0             # <<<<<<<<<<<<<<
 *         height = 0
 *         depth  = 0
 */
    __pyx_v_width = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":689
 *     if desc:
 *         width  = 0
 *         height = 0             # <<<<<<<<<<<<<<
 *         depth  = 0
 * 
 */
    __pyx_v_height = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":690
 *         width  = 0
 *         height = 0
 *         depth  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 */
    __pyx_v_depth = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":692
 *         depth  = 0
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)             # <<<<<<<<<<<<<<
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc(__pyx_v_desc, (&__pyx_v_depth), (&__pyx_v_height), (&__pyx_v_width), (&__pyx_v_driverDesc)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 692, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":693
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = ((__pyx_v_err != ((cudaError_t)cudaSuccess)) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":694
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
      __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 694, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":695
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if extent:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":693
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":687
 *     # Convert from driver API types to runtime API types. extent.Depth = 0
 *     # indicates a 2D array.
 *     if desc:             # <<<<<<<<<<<<<<
 *         width  = 0
 *         height = 0
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":697
 *             return err
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height
 */
  __pyx_t_1 = (__pyx_v_extent != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":698
 * 
 *     if extent:
 *         extent.width  = driverDesc.Width             # <<<<<<<<<<<<<<
 *         extent.height = driverDesc.Height
 *         extent.depth  = driverDesc.Depth
 */
    __pyx_t_5 = __pyx_v_driverDesc.Width;
    __pyx_v_extent->width = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":699
 *     if extent:
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height             # <<<<<<<<<<<<<<
 *         extent.depth  = driverDesc.Depth
 * 
 */
    __pyx_t_5 = __pyx_v_driverDesc.Height;
    __pyx_v_extent->height = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":700
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height
 *         extent.depth  = driverDesc.Depth             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_t_5 = __pyx_v_driverDesc.Depth;
    __pyx_v_extent->depth = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":697
 *             return err
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":702
 *         extent.depth  = driverDesc.Depth
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":658
 * 
 * 
 * cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":705
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DToArray", __pyx_f[0], 705, 1, __PYX_ERR(0, 705, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":708
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 708, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":709
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":710
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":709
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":711
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 711, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":712
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":713
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 713, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":712
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":714
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":705
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DToArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":717
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray(void *__pyx_v_dst, size_t __pyx_v_dpitch, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DFromArray", __pyx_f[0], 717, 1, __PYX_ERR(0, 717, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":720
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 720, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":721
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":722
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":721
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":723
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray(((char *)__pyx_v_dst), __pyx_v_dpitch, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_width, __pyx_v_height, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":724
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":725
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 725, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":724
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":726
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":717
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DFromArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":729
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DArrayToArray", __pyx_f[0], 729, 1, __PYX_ERR(0, 729, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":732
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 732, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":733
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":734
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":733
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":735
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray(__pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_width, __pyx_v_height, __pyx_v_kind); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 735, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":736
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":737
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 737, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":736
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":738
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":729
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DArrayToArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":741
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DToArrayAsync", __pyx_f[0], 741, 1, __PYX_ERR(0, 741, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":744
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":745
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":746
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":745
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":747
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 747, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":748
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":749
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 749, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":748
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":750
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":741
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DToArrayAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":753
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync(void *__pyx_v_dst, size_t __pyx_v_dpitch, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DFromArrayAsync", __pyx_f[0], 753, 1, __PYX_ERR(0, 753, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":756
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 756, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":757
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":758
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":757
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":759
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray(((char *)__pyx_v_dst), __pyx_v_dpitch, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_width, __pyx_v_height, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":760
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":761
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 761, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":760
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":762
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":753
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DFromArrayAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":765
 * 
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D(struct cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct cudaExtent __pyx_v_extent) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemset3D", __pyx_f[0], 765, 1, __PYX_ERR(0, 765, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":768
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 768, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":769
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":770
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":769
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":771
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 771, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":772
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":773
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 773, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":772
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":774
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":765
 * 
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemset3D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":777
 * 
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync(struct cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct cudaExtent __pyx_v_extent, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemset3DAsync", __pyx_f[0], 777, 1, __PYX_ERR(0, 777, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":780
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 780, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":781
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":782
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":781
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":783
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 783, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":784
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":785
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 785, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":784
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":786
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":777
 * 
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemset3DAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":789
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyToArray", __pyx_f[0], 789, 1, __PYX_ERR(0, 789, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":792
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 792, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":793
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":794
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":793
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":795
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_count, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 795, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":796
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":797
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 797, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":796
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":798
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":789
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyToArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":801
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray(void *__pyx_v_dst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyFromArray", __pyx_f[0], 801, 1, __PYX_ERR(0, 801, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":804
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 804, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":805
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":806
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":805
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":807
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray(((char *)__pyx_v_dst), __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_count, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 807, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":808
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":809
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 809, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":808
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":810
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":801
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyFromArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":813
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyToArrayAsync", __pyx_f[0], 813, 1, __PYX_ERR(0, 813, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":816
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 816, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":817
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":818
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":817
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":819
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_count, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 819, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":820
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":821
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 821, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":820
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":822
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":813
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyToArrayAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":825
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync(void *__pyx_v_dst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyFromArrayAsync", __pyx_f[0], 825, 1, __PYX_ERR(0, 825, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":828
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 828, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":829
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":830
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":829
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":831
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray(((char *)__pyx_v_dst), __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_count, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 831, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":832
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":833
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 833, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":832
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":834
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":825
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyFromArrayAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":837
 * 
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPointerAttributes attrib
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes(struct cudaPointerAttributes *__pyx_v_attributes, void const *__pyx_v_ptr) {
  cudaError_t __pyx_v_err;
  struct cudaPointerAttributes __pyx_v_attrib;
  CUcontext __pyx_v_driverContext;
  CUmemorytype __pyx_v_driverMemoryType;
  int __pyx_v_isManaged;
  CUpointer_attribute __pyx_v_query[6];
  void **__pyx_v_data;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  void *__pyx_t_1[6];
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  CUresult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaPointerGetAttributes", __pyx_f[0], 837, 1, __PYX_ERR(0, 837, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":840
 *     cdef cudaError_t err
 *     cdef cudaPointerAttributes attrib
 *     cdef ccuda.CUcontext driverContext = NULL             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUmemorytype driverMemoryType
 *     cdef int isManaged
 */
  __pyx_v_driverContext = NULL;

  /* "cuda/_lib/ccudart/ccudart.pyx":844
 *     cdef int isManaged
 *     cdef ccuda.CUpointer_attribute[6] query
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT             # <<<<<<<<<<<<<<
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 */
  (__pyx_v_query[0]) = CU_POINTER_ATTRIBUTE_CONTEXT;

  /* "cuda/_lib/ccudart/ccudart.pyx":845
 *     cdef ccuda.CUpointer_attribute[6] query
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE             # <<<<<<<<<<<<<<
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 */
  (__pyx_v_query[1]) = CU_POINTER_ATTRIBUTE_MEMORY_TYPE;

  /* "cuda/_lib/ccudart/ccudart.pyx":846
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER             # <<<<<<<<<<<<<<
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED
 */
  (__pyx_v_query[2]) = CU_POINTER_ATTRIBUTE_DEVICE_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":847
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER             # <<<<<<<<<<<<<<
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 */
  (__pyx_v_query[3]) = CU_POINTER_ATTRIBUTE_HOST_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":848
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED             # <<<<<<<<<<<<<<
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 * 
 */
  (__pyx_v_query[4]) = CU_POINTER_ATTRIBUTE_IS_MANAGED;

  /* "cuda/_lib/ccudart/ccudart.pyx":849
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL             # <<<<<<<<<<<<<<
 * 
 *     cdef void** data = [
 */
  (__pyx_v_query[5]) = CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL;

  /* "cuda/_lib/ccudart/ccudart.pyx":851
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 * 
 *     cdef void** data = [             # <<<<<<<<<<<<<<
 *         &driverContext,
 *         &driverMemoryType,
 */
  __pyx_t_1[0] = (&__pyx_v_driverContext);
  __pyx_t_1[1] = (&__pyx_v_driverMemoryType);
  __pyx_t_1[2] = (&__pyx_v_attrib.devicePointer);
  __pyx_t_1[3] = (&__pyx_v_attrib.hostPointer);
  __pyx_t_1[4] = (&__pyx_v_isManaged);
  __pyx_t_1[5] = (&__pyx_v_attrib.device);
  __pyx_v_data = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":860
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_attributes == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":861
 * 
 *     if attributes == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 861, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":862
 *     if attributes == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # Get all the attributes we need
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":860
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":865
 * 
 *     # Get all the attributes we need
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         if attributes != NULL:
 */
  __pyx_t_4 = (sizeof(__pyx_v_query));
  __pyx_t_5 = (sizeof((__pyx_v_query[0])));
  if (unlikely(__pyx_t_5 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 865, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes(((unsigned int)(((double)__pyx_t_4) / ((double)__pyx_t_5))), __pyx_v_query, __pyx_v_data, ((CUdeviceptr_v2)__pyx_v_ptr)); if (unlikely(__pyx_t_6 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 865, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_6);

  /* "cuda/_lib/ccudart/ccudart.pyx":866
 *     # Get all the attributes we need
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         if attributes != NULL:
 *             memset(attributes, 0, sizeof(attributes[0]))
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":867
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)
 *     if err != cudaSuccess:
 *         if attributes != NULL:             # <<<<<<<<<<<<<<
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1
 */
    __pyx_t_2 = ((__pyx_v_attributes != NULL) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":868
 *     if err != cudaSuccess:
 *         if attributes != NULL:
 *             memset(attributes, 0, sizeof(attributes[0]))             # <<<<<<<<<<<<<<
 *             attributes[0].device = -1
 *         _setLastError(err)
 */
      (void)(memset(__pyx_v_attributes, 0, (sizeof((__pyx_v_attributes[0])))));

      /* "cuda/_lib/ccudart/ccudart.pyx":869
 *         if attributes != NULL:
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
      (__pyx_v_attributes[0]).device = -1;

      /* "cuda/_lib/ccudart/ccudart.pyx":867
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)
 *     if err != cudaSuccess:
 *         if attributes != NULL:             # <<<<<<<<<<<<<<
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":870
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 870, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":871
 *             attributes[0].device = -1
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":866
 *     # Get all the attributes we need
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         if attributes != NULL:
 *             memset(attributes, 0, sizeof(attributes[0]))
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":873
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
  switch (__pyx_v_driverMemoryType) {
    case CU_MEMORYTYPE_HOST:

    /* "cuda/_lib/ccudart/ccudart.pyx":874
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
    __pyx_t_2 = (__pyx_v_isManaged != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":875
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 */
      __pyx_v_attrib.type = cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":874
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":877
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeHost             # <<<<<<<<<<<<<<
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 */
    /*else*/ {
      __pyx_v_attrib.type = cudaMemoryTypeHost;
    }
    __pyx_L6:;

    /* "cuda/_lib/ccudart/ccudart.pyx":873
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    case CU_MEMORYTYPE_DEVICE:

    /* "cuda/_lib/ccudart/ccudart.pyx":879
 *             attrib.type = cudaMemoryTypeHost
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
    __pyx_t_2 = (__pyx_v_isManaged != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":880
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeDevice
 */
      __pyx_v_attrib.type = cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":879
 *             attrib.type = cudaMemoryTypeHost
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
      goto __pyx_L7;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":882
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeDevice             # <<<<<<<<<<<<<<
 *     else:
 *          if driverMemoryType == 0:
 */
    /*else*/ {
      __pyx_v_attrib.type = cudaMemoryTypeDevice;
    }
    __pyx_L7:;

    /* "cuda/_lib/ccudart/ccudart.pyx":878
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    default:

    /* "cuda/_lib/ccudart/ccudart.pyx":884
 *             attrib.type = cudaMemoryTypeDevice
 *     else:
 *          if driverMemoryType == 0:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 */
    __pyx_t_2 = ((__pyx_v_driverMemoryType == 0) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":885
 *     else:
 *          if driverMemoryType == 0:
 *             attrib.type = cudaMemoryTypeUnregistered             # <<<<<<<<<<<<<<
 *          else:
 *             if attributes != NULL:
 */
      __pyx_v_attrib.type = cudaMemoryTypeUnregistered;

      /* "cuda/_lib/ccudart/ccudart.pyx":884
 *             attrib.type = cudaMemoryTypeDevice
 *     else:
 *          if driverMemoryType == 0:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 */
      goto __pyx_L8;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":887
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 *             if attributes != NULL:             # <<<<<<<<<<<<<<
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 */
    /*else*/ {
      __pyx_t_2 = ((__pyx_v_attributes != NULL) != 0);
      if (__pyx_t_2) {

        /* "cuda/_lib/ccudart/ccudart.pyx":888
 *          else:
 *             if attributes != NULL:
 *                 memset(attributes, 0, sizeof(attributes[0]))             # <<<<<<<<<<<<<<
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)
 */
        (void)(memset(__pyx_v_attributes, 0, (sizeof((__pyx_v_attributes[0])))));

        /* "cuda/_lib/ccudart/ccudart.pyx":889
 *             if attributes != NULL:
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue
 */
        (__pyx_v_attributes[0]).device = -1;

        /* "cuda/_lib/ccudart/ccudart.pyx":887
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 *             if attributes != NULL:             # <<<<<<<<<<<<<<
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 */
      }

      /* "cuda/_lib/ccudart/ccudart.pyx":890
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 * 
 */
      __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 890, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":891
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # copy to user structure
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;
    }
    __pyx_L8:;
    break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":894
 * 
 *     # copy to user structure
 *     attributes[0] = attrib             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (__pyx_v_attributes[0]) = __pyx_v_attrib;

  /* "cuda/_lib/ccudart/ccudart.pyx":896
 *     attributes[0] = attrib
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":837
 * 
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPointerAttributes attrib
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaPointerGetAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":899
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceFlags(unsigned int *__pyx_v_flags) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_driverContext;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  unsigned int __pyx_v_pcFlags;
  int __pyx_v_pcActive;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceFlags", __pyx_f[0], 899, 1, __PYX_ERR(0, 899, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":901
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 901, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":902
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":903
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     if flags == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":902
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":905
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_flags == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":906
 * 
 *     if flags == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 906, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":907
 *     if flags == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext driverContext
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":905
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":910
 * 
 *     cdef ccuda.CUcontext driverContext
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_driverContext)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 910, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":911
 *     cdef ccuda.CUcontext driverContext
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":912
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 912, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":913
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     # Get the flags from the current context
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":911
 *     cdef ccuda.CUcontext driverContext
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":916
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  __pyx_t_2 = ((__pyx_v_driverContext != NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":917
 *     # Get the flags from the current context
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags(__pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 917, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/ccudart.pyx":918
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":919
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 919, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":918
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":920
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     # Assume first valid device and get its implicit flags
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":916
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":926
 *     cdef unsigned int pcFlags
 *     cdef int pcActive
 *     device = m_global.getDevice(0)             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, 0);

  /* "cuda/_lib/ccudart/ccudart.pyx":927
 *     cdef int pcActive
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState((__pyx_v_device[0]).driverDevice, (&__pyx_v_pcFlags), (&__pyx_v_pcActive)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 927, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":928
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":929
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 929, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":930
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     flags[0] = pcFlags | cudaDeviceMapHost
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":928
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":931
 *         _setLastError(err)
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_flags[0]) = (__pyx_v_pcFlags | __pyx_e_4cuda_7ccudart_cudaDeviceMapHost);

  /* "cuda/_lib/ccudart/ccudart.pyx":932
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":899
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDeviceFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":935
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3D(struct cudaMemcpy3DParms const *__pyx_v_p) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3D", __pyx_f[0], 935, 1, __PYX_ERR(0, 935, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":936
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":937
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":936
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":940
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 940, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":941
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":942
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":941
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":943
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, NULL, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 943, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":944
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":945
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 945, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":944
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":946
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":935
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3D", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":949
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync(struct cudaMemcpy3DParms const *__pyx_v_p, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DAsync", __pyx_f[0], 949, 1, __PYX_ERR(0, 949, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":950
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":951
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":950
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":954
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 954, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":955
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":956
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":955
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":957
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, __pyx_v_stream, 1); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":958
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":959
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 959, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":958
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":960
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":949
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3DAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":963
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess(cudaMemPool_t __pyx_v_memPool, struct cudaMemAccessDesc const *__pyx_v_descList, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  size_t __pyx_v_MAX_DEVICES;
  CUmemAccessDesc __pyx_v_localList[32];
  CUmemAccessDesc *__pyx_v_cuDescList;
  size_t __pyx_v_i;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemPoolSetAccess", __pyx_f[0], 963, 1, __PYX_ERR(0, 963, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":965
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 965, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":966
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":967
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t MAX_DEVICES = 32
 *     cdef ccuda.CUmemAccessDesc localList[32]
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":966
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":968
 *     if err != cudaSuccess:
 *         return err
 *     cdef size_t MAX_DEVICES = 32             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUmemAccessDesc localList[32]
 *     cdef ccuda.CUmemAccessDesc *cuDescList
 */
  __pyx_v_MAX_DEVICES = 32;

  /* "cuda/_lib/ccudart/ccudart.pyx":971
 *     cdef ccuda.CUmemAccessDesc localList[32]
 *     cdef ccuda.CUmemAccessDesc *cuDescList
 *     cdef size_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     if (count > MAX_DEVICES):
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":973
 *     cdef size_t i = 0
 * 
 *     if (count > MAX_DEVICES):             # <<<<<<<<<<<<<<
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_count > __pyx_v_MAX_DEVICES) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":974
 * 
 *     if (count > MAX_DEVICES):
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)             # <<<<<<<<<<<<<<
 *     else:
 *         cuDescList = localList
 */
    __pyx_v_cuDescList = ((CUmemAccessDesc *)calloc((sizeof(CUmemAccessDesc)), __pyx_v_count));

    /* "cuda/_lib/ccudart/ccudart.pyx":973
 *     cdef size_t i = 0
 * 
 *     if (count > MAX_DEVICES):             # <<<<<<<<<<<<<<
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":976
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)
 *     else:
 *         cuDescList = localList             # <<<<<<<<<<<<<<
 * 
 *     if cuDescList == NULL:
 */
  /*else*/ {
    __pyx_v_cuDescList = __pyx_v_localList;
  }
  __pyx_L4:;

  /* "cuda/_lib/ccudart/ccudart.pyx":978
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  __pyx_t_2 = ((__pyx_v_cuDescList == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":979
 * 
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorMemoryAllocation); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 979, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":980
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     while i < count:
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":978
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":982
 *         return cudaErrorMemoryAllocation
 * 
 *     while i < count:             # <<<<<<<<<<<<<<
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id
 */
  while (1) {
    __pyx_t_2 = ((__pyx_v_i < __pyx_v_count) != 0);
    if (!__pyx_t_2) break;

    /* "cuda/_lib/ccudart/ccudart.pyx":983
 * 
 *     while i < count:
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type             # <<<<<<<<<<<<<<
 *         cuDescList[i].location.id = descList[i].location.id
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags
 */
    (__pyx_v_cuDescList[__pyx_v_i]).location.type = ((CUmemLocationType)(__pyx_v_descList[__pyx_v_i]).location.type);

    /* "cuda/_lib/ccudart/ccudart.pyx":984
 *     while i < count:
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id             # <<<<<<<<<<<<<<
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags
 *         i += 1
 */
    __pyx_t_3 = (__pyx_v_descList[__pyx_v_i]).location.id;
    (__pyx_v_cuDescList[__pyx_v_i]).location.id = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":985
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags             # <<<<<<<<<<<<<<
 *         i += 1
 * 
 */
    (__pyx_v_cuDescList[__pyx_v_i]).flags = ((CUmemAccess_flags)(__pyx_v_descList[__pyx_v_i]).flags);

    /* "cuda/_lib/ccudart/ccudart.pyx":986
 *         cuDescList[i].location.id = descList[i].location.id
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 */
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":988
 *         i += 1
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess(__pyx_v_memPool, __pyx_v_cuDescList, __pyx_v_count); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 988, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":989
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":990
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 990, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":991
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     if count > MAX_DEVICES:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":989
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":993
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  __pyx_t_2 = ((__pyx_v_count > __pyx_v_MAX_DEVICES) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":994
 * 
 *     if count > MAX_DEVICES:
 *         free(cuDescList)             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    free(__pyx_v_cuDescList);

    /* "cuda/_lib/ccudart/ccudart.pyx":993
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":996
 *         free(cuDescList)
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":963
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolSetAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":999
 * 
 * 
 * cdef cudaError_t _cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceReset(void) {
  CYTHON_UNUSED int __pyx_v_deviceOrdinal;
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceReset", __pyx_f[0], 999, 1, __PYX_ERR(0, 999, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1000
 * 
 * cdef cudaError_t _cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if not m_global._lazyInitDriver:
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1002
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 *     if not m_global._lazyInitDriver:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lazyInitDriver != 0)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1003
 *     cdef cudaError_t err
 *     if not m_global._lazyInitDriver:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext context
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1002
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 *     if not m_global._lazyInitDriver:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1006
 * 
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1006, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1007
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1008
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1008, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1009
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* device
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1007
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1012
 * 
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context);

  /* "cuda/_lib/ccudart/ccudart.pyx":1013
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:             # <<<<<<<<<<<<<<
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_device != NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1014
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:
 *         err = resetPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1014, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1015
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *     return err
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1016
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1016, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1015
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *     return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1013
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:             # <<<<<<<<<<<<<<
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1017
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":999
 * 
 * 
 * cdef cudaError_t _cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceReset", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1020
 * 
 * 
 * cdef cudaError_t _cudaThreadExit() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaDeviceReset()
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaThreadExit(void) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaThreadExit", __pyx_f[0], 1020, 1, __PYX_ERR(0, 1020, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1021
 * 
 * cdef cudaError_t _cudaThreadExit() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaDeviceReset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaDeviceReset(); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1021, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1020
 * 
 * 
 * cdef cudaError_t _cudaThreadExit() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaDeviceReset()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaThreadExit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1024
 * 
 * 
 * cdef cudaError_t _cudaGetLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetLastError(void) {
  cudaError_t __pyx_v_last_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetLastError", __pyx_f[0], 1024, 1, __PYX_ERR(0, 1024, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1025
 * 
 * cdef cudaError_t _cudaGetLastError() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t last_err = m_global._lastError             # <<<<<<<<<<<<<<
 *     m_global._lastError = cudaSuccess
 *     return last_err
 */
  __pyx_t_1 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lastError;
  __pyx_v_last_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1026
 * cdef cudaError_t _cudaGetLastError() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess             # <<<<<<<<<<<<<<
 *     return last_err
 * 
 */
  __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lastError = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1027
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 *     return last_err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_last_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1024
 * 
 * 
 * cdef cudaError_t _cudaGetLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetLastError", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1030
 * 
 * 
 * cdef cudaError_t _cudaPeekAtLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return m_global._lastError
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPeekAtLastError(void) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaPeekAtLastError", __pyx_f[0], 1030, 1, __PYX_ERR(0, 1030, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1031
 * 
 * cdef cudaError_t _cudaPeekAtLastError() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return m_global._lastError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lastError;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1030
 * 
 * 
 * cdef cudaError_t _cudaPeekAtLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return m_global._lastError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaPeekAtLastError", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1034
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUdevice driverDevice
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDevice(int *__pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  CUdevice __pyx_v_driverDevice;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_cudaDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDevice", __pyx_f[0], 1034, 1, __PYX_ERR(0, 1034, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1038
 *     cdef ccuda.CUdevice driverDevice
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1038, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1039
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1040
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice *cudaDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1039
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1043
 * 
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice((&__pyx_v_driverDevice)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1043, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1044
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 */
  switch (__pyx_v_err) {
    case cudaSuccess:

    /* "cuda/_lib/ccudart/ccudart.pyx":1045
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)             # <<<<<<<<<<<<<<
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 *     elif err == cudaErrorDeviceUninitialized:
 */
    __pyx_v_cudaDevice = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_driverDevice);

    /* "cuda/_lib/ccudart/ccudart.pyx":1046
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal             # <<<<<<<<<<<<<<
 *     elif err == cudaErrorDeviceUninitialized:
 *         # Like C Runtime, default to first device and let context creation happen in another call
 */
    __pyx_t_4 = (__pyx_v_cudaDevice[0]).deviceOrdinal;
    (__pyx_v_deviceOrdinal[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1044
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 */
    break;
    case cudaErrorDeviceUninitialized:

    /* "cuda/_lib/ccudart/ccudart.pyx":1050
 *         # Like C Runtime, default to first device and let context creation happen in another call
 *         # By default, device 0 would initialized
 *         deviceOrdinal[0] = 0             # <<<<<<<<<<<<<<
 *         err = cudaSuccess
 *     return err
 */
    (__pyx_v_deviceOrdinal[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1051
 *         # By default, device 0 would initialized
 *         deviceOrdinal[0] = 0
 *         err = cudaSuccess             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_v_err = cudaSuccess;

    /* "cuda/_lib/ccudart/ccudart.pyx":1047
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 *     elif err == cudaErrorDeviceUninitialized:             # <<<<<<<<<<<<<<
 *         # Like C Runtime, default to first device and let context creation happen in another call
 *         # By default, device 0 would initialized
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1052
 *         deviceOrdinal[0] = 0
 *         err = cudaSuccess
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1034
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUdevice driverDevice
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1055
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDevice(int __pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDevice", __pyx_f[0], 1055, 1, __PYX_ERR(0, 1055, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1059
 *     cdef cudaPythonDevice *device
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1059, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1060
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1061
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1060
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1063
 *         return err
 * 
 *     device = m_global.getDevice(deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         _setLastError(err)
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_deviceOrdinal);

  /* "cuda/_lib/ccudart/ccudart.pyx":1064
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = ((__pyx_v_device == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1065
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1065, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1066
 *     if device == NULL:
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     if device.primaryContext == NULL:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1064
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1068
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  __pyx_t_2 = ((__pyx_v_device->primaryContext == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1069
 * 
 *     if device.primaryContext == NULL:
 *         initPrimaryContext(device)             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1069, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1068
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1071
 *         initPrimaryContext(device)
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent(__pyx_v_device->primaryContext); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1071, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1072
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1073
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1073, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1072
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1074
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1055
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSetDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1077
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceProperties(struct cudaDeviceProp *__pyx_v_prop, int __pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  struct cudaDeviceProp __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceProperties", __pyx_f[0], 1077, 1, __PYX_ERR(0, 1077, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1079
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1079, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1080
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1081
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1080
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1083
 *         return err
 * 
 *     device = m_global.getDevice(deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         _setLastError(err)
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_deviceOrdinal);

  /* "cuda/_lib/ccudart/ccudart.pyx":1084
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = ((__pyx_v_device == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1085
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1085, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1086
 *     if device == NULL:
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1084
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1088
 *         return cudaErrorInvalidDevice
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.kernelExecTimeoutEnabled), CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1088, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1089
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1090
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1090, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1091
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1089
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1093
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.computeMode), CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1093, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1094
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1095
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1095, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1096
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1094
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1098
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.clockRate), CU_DEVICE_ATTRIBUTE_CLOCK_RATE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1099
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1100
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1100, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1101
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1099
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1103
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.memoryClockRate), CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1103, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1104
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1105
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1105, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1106
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1104
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1108
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.singleToDoublePrecisionPerfRatio), CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1108, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1109
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1110
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1110, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1111
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     prop[0] = device[0].deviceProperties
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1109
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1113
 *         return err
 * 
 *     prop[0] = device[0].deviceProperties             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  __pyx_t_4 = (__pyx_v_device[0]).deviceProperties;
  (__pyx_v_prop[0]) = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1115
 *     prop[0] = device[0].deviceProperties
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1077
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDeviceProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1118
 * 
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice(int *__pyx_v_device, struct cudaDeviceProp const *__pyx_v_prop) {
  cudaError_t __pyx_v_err;
  int __pyx_v_best;
  int __pyx_v_maxrank;
  int __pyx_v_rank;
  char *__pyx_v_dontCare_name;
  int __pyx_v_dontCare_major;
  int __pyx_v_dontCare_minor;
  size_t __pyx_v_dontCare_totalGlobalMem;
  int __pyx_v_deviceOrdinal;
  struct cudaDeviceProp *__pyx_v_devProp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  char __pyx_t_4[1];
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaChooseDevice", __pyx_f[0], 1118, 1, __PYX_ERR(0, 1118, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1119
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if device == NULL or prop == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_device == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_prop == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1120
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1120, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1121
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1119
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if device == NULL or prop == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1124
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1124, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1125
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1126
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef int best = -1
 *     cdef int maxrank = -1
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1125
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1127
 *     if err != cudaSuccess:
 *         return err
 *     cdef int best = -1             # <<<<<<<<<<<<<<
 *     cdef int maxrank = -1
 *     cdef int rank
 */
  __pyx_v_best = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1128
 *         return err
 *     cdef int best = -1
 *     cdef int maxrank = -1             # <<<<<<<<<<<<<<
 *     cdef int rank
 *     cdef char* dontCare_name = [b'\0']
 */
  __pyx_v_maxrank = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1130
 *     cdef int maxrank = -1
 *     cdef int rank
 *     cdef char* dontCare_name = [b'\0']             # <<<<<<<<<<<<<<
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1
 */
  __pyx_t_4[0] = '\x00';
  __pyx_v_dontCare_name = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1131
 *     cdef int rank
 *     cdef char* dontCare_name = [b'\0']
 *     cdef int dontCare_major = -1             # <<<<<<<<<<<<<<
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0
 */
  __pyx_v_dontCare_major = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1132
 *     cdef char* dontCare_name = [b'\0']
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1             # <<<<<<<<<<<<<<
 *     cdef size_t dontCare_totalGlobalMem = 0
 *     cdef int deviceOrdinal = 0
 */
  __pyx_v_dontCare_minor = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1133
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaDeviceProp *devProp
 */
  __pyx_v_dontCare_totalGlobalMem = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1134
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaDeviceProp *devProp
 * 
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1137
 *     cdef cudaDeviceProp *devProp
 * 
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 */
  __pyx_t_5 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_7;

    /* "cuda/_lib/ccudart/ccudart.pyx":1138
 * 
 *     for deviceOrdinal in range(m_global._numDevices):
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties             # <<<<<<<<<<<<<<
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 */
    __pyx_v_devProp = (&(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceList[__pyx_v_deviceOrdinal]).deviceProperties);

    /* "cuda/_lib/ccudart/ccudart.pyx":1139
 *     for deviceOrdinal in range(m_global._numDevices):
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0             # <<<<<<<<<<<<<<
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 */
    __pyx_v_rank = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1140
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 */
    __pyx_t_1 = ((strncmp((__pyx_v_prop[0]).name, __pyx_v_dontCare_name, (sizeof((__pyx_v_prop[0]).name))) != 0) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1141
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0             # <<<<<<<<<<<<<<
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 */
      __pyx_v_rank = (__pyx_v_rank + (strncmp((__pyx_v_prop[0]).name, (__pyx_v_devProp[0]).name, (sizeof((__pyx_v_prop[0]).name))) == 0));

      /* "cuda/_lib/ccudart/ccudart.pyx":1140
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1142
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 */
    __pyx_t_1 = (((__pyx_v_prop[0]).major != __pyx_v_dontCare_major) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1143
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major             # <<<<<<<<<<<<<<
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).major <= (__pyx_v_devProp[0]).major));

      /* "cuda/_lib/ccudart/ccudart.pyx":1142
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1144
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    __pyx_t_2 = (((__pyx_v_prop[0]).major == (__pyx_v_devProp[0]).major) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_2 = (((__pyx_v_prop[0]).minor != __pyx_v_dontCare_minor) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1145
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor             # <<<<<<<<<<<<<<
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).minor <= (__pyx_v_devProp[0]).minor));

      /* "cuda/_lib/ccudart/ccudart.pyx":1144
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1146
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 */
    __pyx_t_1 = (((__pyx_v_prop[0]).totalGlobalMem != __pyx_v_dontCare_totalGlobalMem) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1147
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem             # <<<<<<<<<<<<<<
 *         if (rank > maxrank):
 *             maxrank = rank
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).totalGlobalMem <= (__pyx_v_devProp[0]).totalGlobalMem));

      /* "cuda/_lib/ccudart/ccudart.pyx":1146
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1148
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):             # <<<<<<<<<<<<<<
 *             maxrank = rank
 *             best = deviceOrdinal
 */
    __pyx_t_1 = ((__pyx_v_rank > __pyx_v_maxrank) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1149
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 *             maxrank = rank             # <<<<<<<<<<<<<<
 *             best = deviceOrdinal
 * 
 */
      __pyx_v_maxrank = __pyx_v_rank;

      /* "cuda/_lib/ccudart/ccudart.pyx":1150
 *         if (rank > maxrank):
 *             maxrank = rank
 *             best = deviceOrdinal             # <<<<<<<<<<<<<<
 * 
 *     device[0] = best
 */
      __pyx_v_best = __pyx_v_deviceOrdinal;

      /* "cuda/_lib/ccudart/ccudart.pyx":1148
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):             # <<<<<<<<<<<<<<
 *             maxrank = rank
 *             best = deviceOrdinal
 */
    }
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1152
 *             best = deviceOrdinal
 * 
 *     device[0] = best             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_device[0]) = __pyx_v_best;

  /* "cuda/_lib/ccudart/ccudart.pyx":1153
 * 
 *     device[0] = best
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1118
 * 
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaChooseDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1156
 * 
 * 
 * cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyArrayToArray", __pyx_f[0], 1156, 1, __PYX_ERR(0, 1156, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1159
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1159, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1160
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1161
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1160
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1162
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray(__pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_count, __pyx_v_kind); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1162, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1163
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1164
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1164, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1163
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1165
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1156
 * 
 * 
 * cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyArrayToArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1168
 * 
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc(struct cudaChannelFormatDesc *__pyx_v_desc, cudaArray_const_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetChannelDesc", __pyx_f[0], 1168, 1, __PYX_ERR(0, 1168, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1171
 *     cdef cudaError_t err
 * 
 *     if desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_desc == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1172
 * 
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1172, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1173
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1171
 *     cdef cudaError_t err
 * 
 *     if desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1175
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1175, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1176
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1177
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1176
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1178
 *     if err != cudaSuccess:
 *         return err
 *     err = getChannelDesc(array, desc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc(__pyx_v_array, __pyx_v_desc); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1178, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1179
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1180
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1180, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1179
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1181
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1168
 * 
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetChannelDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1184
 * 
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject(cudaTextureObject_t *__pyx_v_pTexObject, struct cudaResourceDesc const *__pyx_v_pResDesc, struct cudaTextureDesc const *__pyx_v_pTexDesc, struct cudaResourceViewDesc const *__pyx_v_pResViewDesc) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  struct cudaTextureDesc_v2 __pyx_v_texDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateTextureObject", __pyx_f[0], 1184, 1, __PYX_ERR(0, 1184, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1187
 *     cdef cudaError_t err
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_pResDesc == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_pTexDesc == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1188
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1188, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1189
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUDA_RESOURCE_DESC rd
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1187
 *     cdef cudaError_t err
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1195
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 *     cdef cudaTextureDesc_v2 texDesc
 *     memcpy(&texDesc, pTexDesc, sizeof(cudaTextureDesc))             # <<<<<<<<<<<<<<
 *     texDesc.seamlessCubemap = 0
 * 
 */
  (void)(memcpy((&__pyx_v_texDesc), __pyx_v_pTexDesc, (sizeof(struct cudaTextureDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1196
 *     cdef cudaTextureDesc_v2 texDesc
 *     memcpy(&texDesc, pTexDesc, sizeof(cudaTextureDesc))
 *     texDesc.seamlessCubemap = 0             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_texDesc.seamlessCubemap = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1198
 *     texDesc.seamlessCubemap = 0
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1198, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1199
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1200
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1199
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1201
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_pResViewDesc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1202
 *         return err
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)             # <<<<<<<<<<<<<<
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), (&__pyx_v_texDesc), (&__pyx_v_rvd), __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1202, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1201
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1204
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), (&__pyx_v_texDesc), NULL, __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1204, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;
  }
  __pyx_L7:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1205
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1206
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1206, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1207
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     if pResViewDesc:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1205
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1208
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_pResViewDesc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1209
 *         return err
 *     if pResViewDesc:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)             # <<<<<<<<<<<<<<
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), (&__pyx_v_rvd)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1209, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":1208
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1211
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), NULL); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1211, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);
  }
  __pyx_L9:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1212
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1213
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1213, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1212
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1214
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaCreateTextureObject_v2(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc_v2* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1184
 * 
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateTextureObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1216
 *     return err
 * 
 * cdef cudaError_t _cudaCreateTextureObject_v2(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc_v2* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject_v2(cudaTextureObject_t *__pyx_v_pTexObject, struct cudaResourceDesc const *__pyx_v_pResDesc, struct cudaTextureDesc_v2 const *__pyx_v_pTexDesc, struct cudaResourceViewDesc const *__pyx_v_pResViewDesc) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateTextureObject_v2", __pyx_f[0], 1216, 1, __PYX_ERR(0, 1216, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1219
 *     cdef cudaError_t err
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_pResDesc == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_pTexDesc == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1220
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1220, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1221
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUDA_RESOURCE_DESC rd
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1219
 *     cdef cudaError_t err
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1227
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1227, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1228
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1229
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1228
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1230
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_pResViewDesc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1231
 *         return err
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)             # <<<<<<<<<<<<<<
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), __pyx_v_pTexDesc, (&__pyx_v_rvd), __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1231, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1230
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 *     else:
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1233
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), __pyx_v_pTexDesc, NULL, __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1233, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;
  }
  __pyx_L7:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1234
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1235
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1235, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1236
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     if pResViewDesc:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1234
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1237
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_pResViewDesc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1238
 *         return err
 *     if pResViewDesc:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)             # <<<<<<<<<<<<<<
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), (&__pyx_v_rvd)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1238, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":1237
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1240
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), NULL); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1240, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);
  }
  __pyx_L9:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1241
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1242
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1242, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1241
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1243
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1216
 *     return err
 * 
 * cdef cudaError_t _cudaCreateTextureObject_v2(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc_v2* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateTextureObject_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1245
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *__pyx_v_pTexDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  struct cudaResourceDesc __pyx_v_resDesc;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  struct cudaTextureDesc_v2 __pyx_v_texDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectTextureDesc", __pyx_f[0], 1245, 1, __PYX_ERR(0, 1245, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1253
 *     cdef cudaTextureDesc_v2 texDesc
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1253, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1254
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1255
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1254
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1256
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1256, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1257
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1258
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1258, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1259
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1257
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1260
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc((&__pyx_v_td), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1260, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1261
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1262
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1262, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1263
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1261
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1264
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), (&__pyx_v_texDesc), (&__pyx_v_td), NULL, NULL); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1264, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1265
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1266
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1266, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1267
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1265
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1268
 *         _setLastError(err)
 *         return err
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (void)(memcpy(__pyx_v_pTexDesc, (&__pyx_v_texDesc), (sizeof(struct cudaTextureDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1270
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc_v2(cudaTextureDesc_v2* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1245
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectTextureDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1272
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc_v2(cudaTextureDesc_v2* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc_v2(struct cudaTextureDesc_v2 *__pyx_v_pTexDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  struct cudaResourceDesc __pyx_v_resDesc;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectTextureDesc_v2", __pyx_f[0], 1272, 1, __PYX_ERR(0, 1272, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1279
 *     cdef ccuda.CUDA_TEXTURE_DESC td
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1279, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1280
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1281
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1280
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1282
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1282, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1283
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1284
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1284, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1285
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1283
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1286
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc((&__pyx_v_td), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1286, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1287
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1288
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1288, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1289
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1287
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1290
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), __pyx_v_pTexDesc, (&__pyx_v_td), NULL, NULL); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1290, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1291
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1292
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1292, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1293
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1291
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1295
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1272
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc_v2(cudaTextureDesc_v2* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectTextureDesc_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1297
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaResourceDesc resDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *__pyx_v_pResViewDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  struct cudaResourceDesc __pyx_v_resDesc;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectResourceViewDesc", __pyx_f[0], 1297, 1, __PYX_ERR(0, 1297, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1303
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1303, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1304
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1305
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1304
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1306
 *     if err != cudaSuccess:
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1306, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1307
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1308
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1308, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1309
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1307
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1310
 *         _setLastError(err)
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc((&__pyx_v_rvd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1310, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1311
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1312
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1312, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1313
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1311
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1314
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), NULL, NULL, __pyx_v_pResViewDesc, (&__pyx_v_rvd)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1314, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1315
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1316
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1316, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1317
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1315
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1319
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1297
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaResourceDesc resDesc
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectResourceViewDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1322
 * 
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, cudaUUID_t* pExportTableId) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable(void const **__pyx_v_ppExportTable, cudaUUID_t *__pyx_v_pExportTableId) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetExportTable", __pyx_f[0], 1322, 1, __PYX_ERR(0, 1322, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1325
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1325, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1326
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1327
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1326
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1328
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable(__pyx_v_ppExportTable, ((CUuuid *)__pyx_v_pExportTableId)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1328, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1329
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1330
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1330, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1329
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1331
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1322
 * 
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, cudaUUID_t* pExportTableId) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetExportTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1334
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer(struct cudaMemcpy3DPeerParms const *__pyx_v_p) {
  cudaError_t __pyx_v_err;
  struct cudaMemcpy3DParms __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  cudaArray_t __pyx_t_3;
  struct cudaPos __pyx_t_4;
  struct cudaPitchedPtr __pyx_t_5;
  struct cudaExtent __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DPeer", __pyx_f[0], 1334, 1, __PYX_ERR(0, 1334, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1335
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1336
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1336, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1337
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1335
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1341
 *     cdef cudaError_t err
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1342
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1342, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1343
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1344
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1343
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1345
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1346
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_4 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1347
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr             # <<<<<<<<<<<<<<
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 */
  __pyx_t_5 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1348
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray             # <<<<<<<<<<<<<<
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1349
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos             # <<<<<<<<<<<<<<
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 */
  __pyx_t_4 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1350
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr             # <<<<<<<<<<<<<<
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 */
  __pyx_t_5 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1351
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent             # <<<<<<<<<<<<<<
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 */
  __pyx_t_6 = (__pyx_v_p[0]).extent;
  __pyx_v_cp.extent = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1352
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice             # <<<<<<<<<<<<<<
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 */
  __pyx_v_cp.kind = cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1354
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D((&__pyx_v_cp), 1, (__pyx_v_p[0]).srcDevice, (__pyx_v_p[0]).dstDevice, NULL, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1354, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1355
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1356
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1356, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1355
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1357
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1334
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3DPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1359
 *     return err
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync(struct cudaMemcpy3DPeerParms const *__pyx_v_p, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  struct cudaMemcpy3DParms __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  cudaArray_t __pyx_t_3;
  struct cudaPos __pyx_t_4;
  struct cudaPitchedPtr __pyx_t_5;
  struct cudaExtent __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DPeerAsync", __pyx_f[0], 1359, 1, __PYX_ERR(0, 1359, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1360
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1361
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1361, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1362
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1360
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1366
 *     cdef cudaError_t err
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1368
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1368, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1369
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1370
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1369
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1371
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1372
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_4 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1373
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr             # <<<<<<<<<<<<<<
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 */
  __pyx_t_5 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1374
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray             # <<<<<<<<<<<<<<
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1375
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos             # <<<<<<<<<<<<<<
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 */
  __pyx_t_4 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1376
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr             # <<<<<<<<<<<<<<
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 */
  __pyx_t_5 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1377
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent             # <<<<<<<<<<<<<<
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 */
  __pyx_t_6 = (__pyx_v_p[0]).extent;
  __pyx_v_cp.extent = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1378
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice             # <<<<<<<<<<<<<<
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 */
  __pyx_v_cp.kind = cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1380
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D((&__pyx_v_cp), 1, (__pyx_v_p[0]).srcDevice, (__pyx_v_p[0]).dstDevice, __pyx_v_stream, 1); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1380, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1381
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1382
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1382, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1381
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1383
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1359
 *     return err
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3DPeerAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1386
 * 
 * 
 * cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d
 */

static struct cudaPitchedPtr __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPitchedPtr(void *__pyx_v_d, size_t __pyx_v_p, size_t __pyx_v_xsz, size_t __pyx_v_ysz) {
  struct cudaPitchedPtr __pyx_v_s;
  struct cudaPitchedPtr __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_make_cudaPitchedPtr", __pyx_f[0], 1386, 1, __PYX_ERR(0, 1386, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1388
 * cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil:
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d             # <<<<<<<<<<<<<<
 *     s.pitch = p
 *     s.xsize = xsz
 */
  __pyx_v_s.ptr = __pyx_v_d;

  /* "cuda/_lib/ccudart/ccudart.pyx":1389
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d
 *     s.pitch = p             # <<<<<<<<<<<<<<
 *     s.xsize = xsz
 *     s.ysize = ysz
 */
  __pyx_v_s.pitch = __pyx_v_p;

  /* "cuda/_lib/ccudart/ccudart.pyx":1390
 *     s.ptr   = d
 *     s.pitch = p
 *     s.xsize = xsz             # <<<<<<<<<<<<<<
 *     s.ysize = ysz
 *     return s
 */
  __pyx_v_s.xsize = __pyx_v_xsz;

  /* "cuda/_lib/ccudart/ccudart.pyx":1391
 *     s.pitch = p
 *     s.xsize = xsz
 *     s.ysize = ysz             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
  __pyx_v_s.ysize = __pyx_v_ysz;

  /* "cuda/_lib/ccudart/ccudart.pyx":1392
 *     s.xsize = xsz
 *     s.ysize = ysz
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1386
 * 
 * 
 * cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.ccudart._make_cudaPitchedPtr", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1395
 * 
 * 
 * cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPos p
 *     p.x = x
 */

static struct cudaPos __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPos(size_t __pyx_v_x, size_t __pyx_v_y, size_t __pyx_v_z) {
  struct cudaPos __pyx_v_p;
  struct cudaPos __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_make_cudaPos", __pyx_f[0], 1395, 1, __PYX_ERR(0, 1395, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1397
 * cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) nogil:
 *     cdef cudaPos p
 *     p.x = x             # <<<<<<<<<<<<<<
 *     p.y = y
 *     p.z = z
 */
  __pyx_v_p.x = __pyx_v_x;

  /* "cuda/_lib/ccudart/ccudart.pyx":1398
 *     cdef cudaPos p
 *     p.x = x
 *     p.y = y             # <<<<<<<<<<<<<<
 *     p.z = z
 *     return p
 */
  __pyx_v_p.y = __pyx_v_y;

  /* "cuda/_lib/ccudart/ccudart.pyx":1399
 *     p.x = x
 *     p.y = y
 *     p.z = z             # <<<<<<<<<<<<<<
 *     return p
 * 
 */
  __pyx_v_p.z = __pyx_v_z;

  /* "cuda/_lib/ccudart/ccudart.pyx":1400
 *     p.y = y
 *     p.z = z
 *     return p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1395
 * 
 * 
 * cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPos p
 *     p.x = x
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.ccudart._make_cudaPos", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1403
 * 
 * 
 * cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent e
 *     e.width  = w
 */

static struct cudaExtent __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaExtent(size_t __pyx_v_w, size_t __pyx_v_h, size_t __pyx_v_d) {
  struct cudaExtent __pyx_v_e;
  struct cudaExtent __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_make_cudaExtent", __pyx_f[0], 1403, 1, __PYX_ERR(0, 1403, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1405
 * cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) nogil:
 *     cdef cudaExtent e
 *     e.width  = w             # <<<<<<<<<<<<<<
 *     e.height = h
 *     e.depth  = d
 */
  __pyx_v_e.width = __pyx_v_w;

  /* "cuda/_lib/ccudart/ccudart.pyx":1406
 *     cdef cudaExtent e
 *     e.width  = w
 *     e.height = h             # <<<<<<<<<<<<<<
 *     e.depth  = d
 *     return e
 */
  __pyx_v_e.height = __pyx_v_h;

  /* "cuda/_lib/ccudart/ccudart.pyx":1407
 *     e.width  = w
 *     e.height = h
 *     e.depth  = d             # <<<<<<<<<<<<<<
 *     return e
 * 
 */
  __pyx_v_e.depth = __pyx_v_d;

  /* "cuda/_lib/ccudart/ccudart.pyx":1408
 *     e.height = h
 *     e.depth  = d
 *     return e             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_e;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1403
 * 
 * 
 * cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent e
 *     e.width  = w
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.ccudart._make_cudaExtent", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1411
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForDevice(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForDevice(CYTHON_UNUSED double *__pyx_v_d) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDoubleForDevice", __pyx_f[0], 1411, 1, __PYX_ERR(0, 1411, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1412
 * 
 * cdef cudaError_t _cudaSetDoubleForDevice(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1411
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForDevice(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSetDoubleForDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1415
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForHost(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForHost(CYTHON_UNUSED double *__pyx_v_d) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDoubleForHost", __pyx_f[0], 1415, 1, __PYX_ERR(0, 1415, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1416
 * 
 * cdef cudaError_t _cudaSetDoubleForHost(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1415
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForHost(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSetDoubleForHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1419
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     flags &= ~cudaDeviceMapHost
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDeviceFlags(unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_scheduleFlags;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDeviceFlags", __pyx_f[0], 1419, 1, __PYX_ERR(0, 1419, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1421
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     flags &= ~cudaDeviceMapHost             # <<<<<<<<<<<<<<
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_flags = (__pyx_v_flags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMapHost));

  /* "cuda/_lib/ccudart/ccudart.pyx":1422
 *     cdef cudaError_t err
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_flags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMask)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1423
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1423, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1424
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1422
 *     cdef cudaError_t err
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1425
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask             # <<<<<<<<<<<<<<
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 *                           scheduleFlags != cudaDeviceScheduleYield and
 */
  __pyx_v_scheduleFlags = (__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaDeviceScheduleMask);

  /* "cuda/_lib/ccudart/ccudart.pyx":1426
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  __pyx_t_3 = (__pyx_v_scheduleFlags != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1428
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  switch (__pyx_v_scheduleFlags) {
    case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleSpin:

    /* "cuda/_lib/ccudart/ccudart.pyx":1426
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
    case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleYield:

    /* "cuda/_lib/ccudart/ccudart.pyx":1427
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 *                           scheduleFlags != cudaDeviceScheduleYield and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)
 */
    case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleBlockingSync:

    /* "cuda/_lib/ccudart/ccudart.pyx":1426
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
    __pyx_t_3 = 0;
    break;
    default:
    __pyx_t_3 = 1;
    break;
  }
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1429
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1429, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1430
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1426
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1431
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1431, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1432
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1433
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext context
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1432
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1436
 * 
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1436, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1437
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1438
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1438, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1439
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* device
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1437
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1442
 * 
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context);

  /* "cuda/_lib/ccudart/ccudart.pyx":1443
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_1 = ((__pyx_v_device == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1446
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1443
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1448
 *         return cudaErrorIncompatibleDriverContext
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2((__pyx_v_device[0]).driverDevice, __pyx_v_flags); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1448, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1449
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1450
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1450, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1449
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1451
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1419
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     flags &= ~cudaDeviceMapHost
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSetDeviceFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1454
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if nodeParams == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemAllocNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaMemAllocNodeParams *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemAllocNode", __pyx_f[0], 1454, 1, __PYX_ERR(0, 1454, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1456
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_nodeParams == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1457
 *     cdef cudaError_t err
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1457, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1458
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1456
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1460
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1460, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1461
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1462
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1461
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1463
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, ((CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1463, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1464
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1465
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1465, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1464
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1466
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1454
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if nodeParams == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemAllocNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1469
 * 
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if params_out == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemAllocNodeParams *__pyx_v_params_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemAllocNodeGetParams", __pyx_f[0], 1469, 1, __PYX_ERR(0, 1469, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1471
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if params_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_params_out == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1472
 *     cdef cudaError_t err
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1472, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1473
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1471
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if params_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1475
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1475, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1476
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1477
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1476
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1478
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams(__pyx_v_node, ((CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_params_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1479
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1480
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1480, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1479
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1481
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1469
 * 
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if params_out == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemAllocNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1484
 * 
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if dptr_out == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams(cudaGraphNode_t __pyx_v_node, void *__pyx_v_dptr_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemFreeNodeGetParams", __pyx_f[0], 1484, 1, __PYX_ERR(0, 1484, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1486
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if dptr_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_dptr_out == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1487
 *     cdef cudaError_t err
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1487, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1488
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1486
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if dptr_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1490
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1490, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1491
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1492
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1491
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1493
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams(__pyx_v_node, ((CUdeviceptr *)__pyx_v_dptr_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1493, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1494
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1495
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1495, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1494
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1496
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1484
 * 
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if dptr_out == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemFreeNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1499
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise(void const *__pyx_v_devPtr, size_t __pyx_v_count, enum cudaMemoryAdvise __pyx_v_advice, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemAdvise", __pyx_f[0], 1499, 1, __PYX_ERR(0, 1499, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1501
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, ((CUmem_advise)__pyx_v_advice), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1501, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1502
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1503
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1503, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1502
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1504
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1499
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemAdvise", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1507
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute(void *__pyx_v_data, size_t __pyx_v_dataSize, enum cudaMemRangeAttribute __pyx_v_attribute, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemRangeGetAttribute", __pyx_f[0], 1507, 1, __PYX_ERR(0, 1507, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1509
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute(__pyx_v_data, __pyx_v_dataSize, ((CUmem_range_attribute)__pyx_v_attribute), ((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1509, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1510
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1511
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1511, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1510
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1512
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1507
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemRangeGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1515
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttributes(void **__pyx_v_data, size_t *__pyx_v_dataSizes, enum cudaMemRangeAttribute *__pyx_v_attributes, size_t __pyx_v_numAttributes, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemRangeGetAttributes", __pyx_f[0], 1515, 1, __PYX_ERR(0, 1515, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1517
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes(__pyx_v_data, __pyx_v_dataSizes, ((CUmem_range_attribute *)__pyx_v_attributes), __pyx_v_numAttributes, ((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1517, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1518
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1519
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1519, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1518
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1520
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1515
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemRangeGetAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1523
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceCount(int *__pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceCount", __pyx_f[0], 1523, 1, __PYX_ERR(0, 1523, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1525
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1525, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1526
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     count[0] = m_global._numDevices
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1527
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     count[0] = m_global._numDevices
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1526
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     count[0] = m_global._numDevices
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1528
 *     if err != cudaSuccess:
 *         return err
 *     count[0] = m_global._numDevices             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_3 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  (__pyx_v_count[0]) = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1529
 *         return err
 *     count[0] = m_global._numDevices
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1523
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDeviceCount", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1532
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetAttribute(int *__pyx_v_value, enum cudaDeviceAttr __pyx_v_attr, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetAttribute", __pyx_f[0], 1532, 1, __PYX_ERR(0, 1532, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1534
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute(__pyx_v_value, ((CUdevice_attribute)__pyx_v_attr), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1534, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1535
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1536
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1536, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1535
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1537
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1532
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1540
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig __pyx_v_config) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceSetSharedMemConfig", __pyx_f[0], 1540, 1, __PYX_ERR(0, 1540, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1542
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1542, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1543
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1544
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1543
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1545
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig(((CUsharedconfig)__pyx_v_config)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1545, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1546
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1547
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1547, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1546
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1548
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1540
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetSharedMemConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1551
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId(int *__pyx_v_device, char const *__pyx_v_pciBusId) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetByPCIBusId", __pyx_f[0], 1551, 1, __PYX_ERR(0, 1551, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1553
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId(((CUdevice *)__pyx_v_device), __pyx_v_pciBusId); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1553, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1554
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1555
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1555, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1554
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1556
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1551
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetByPCIBusId", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1559
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetPCIBusId(char *__pyx_v_pciBusId, int __pyx_v_length, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetPCIBusId", __pyx_f[0], 1559, 1, __PYX_ERR(0, 1559, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1561
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId(__pyx_v_pciBusId, __pyx_v_length, ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1562
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1563
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1563, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1562
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1564
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1559
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetPCIBusId", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1567
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetP2PAttribute(int *__pyx_v_value, enum cudaDeviceP2PAttr __pyx_v_attr, int __pyx_v_srcDevice, int __pyx_v_dstDevice) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetP2PAttribute", __pyx_f[0], 1567, 1, __PYX_ERR(0, 1567, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1569
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute(__pyx_v_value, ((CUdevice_P2PAttribute)__pyx_v_attr), ((CUdevice)__pyx_v_srcDevice), ((CUdevice)__pyx_v_dstDevice)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1569, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1570
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1571
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1571, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1570
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1572
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1567
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetP2PAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1575
 * 
 * 
 * cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetSparseProperties(struct cudaArraySparseProperties *__pyx_v_sparseProperties, cudaArray_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaArrayGetSparseProperties", __pyx_f[0], 1575, 1, __PYX_ERR(0, 1575, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1578
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  __pyx_t_1 = ((!(__pyx_v_sparseProperties != 0)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1579
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1579, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1580
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1578
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1581
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 */
  (void)(memset(__pyx_v_sparseProperties, 0, (sizeof(struct cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1583
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1584
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  __pyx_t_1 = ((__pyx_v_err == cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1585
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1586
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize             # <<<<<<<<<<<<<<
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 */
    __pyx_t_5 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1587
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1588
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1589
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1590
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1584
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1592
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1593
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1593, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1592
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1594
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1575
 * 
 * 
 * cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetSparseProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1597
 * 
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *__pyx_v_sparseProperties, cudaMipmappedArray_t __pyx_v_mipmap) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMipmappedArrayGetSparseProperties", __pyx_f[0], 1597, 1, __PYX_ERR(0, 1597, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1600
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  __pyx_t_1 = ((!(__pyx_v_sparseProperties != 0)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1601
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1601, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1602
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1600
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1603
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 */
  (void)(memset(__pyx_v_sparseProperties, 0, (sizeof(struct cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1605
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((CUmipmappedArray)__pyx_v_mipmap)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1605, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1606
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  __pyx_t_1 = ((__pyx_v_err == cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1607
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1608
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize             # <<<<<<<<<<<<<<
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 */
    __pyx_t_5 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1609
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1610
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1611
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1612
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1606
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1614
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1615
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1615, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1614
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1616
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1597
 * 
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMipmappedArrayGetSparseProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1619
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer(int *__pyx_v_canAccessPeer, int __pyx_v_device, int __pyx_v_peerDevice) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_driverDevice;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_driverPeerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceCanAccessPeer", __pyx_f[0], 1619, 1, __PYX_ERR(0, 1619, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1621
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1621, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1622
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef cudaPythonDevice *driverDevice
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1623
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *driverDevice
 *     cdef cudaPythonDevice *driverPeerDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1622
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef cudaPythonDevice *driverDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1626
 *     cdef cudaPythonDevice *driverDevice
 *     cdef cudaPythonDevice *driverPeerDevice
 *     driverDevice = m_global.getDevice(device)             # <<<<<<<<<<<<<<
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 */
  __pyx_v_driverDevice = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_device);

  /* "cuda/_lib/ccudart/ccudart.pyx":1627
 *     cdef cudaPythonDevice *driverPeerDevice
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_v_driverPeerDevice = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1628
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
  __pyx_t_3 = ((__pyx_v_driverDevice == NULL) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_driverPeerDevice == NULL) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1629
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1628
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1631
 *         return cudaErrorInvalidDevice
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer(__pyx_v_canAccessPeer, __pyx_v_driverDevice->driverDevice, __pyx_v_driverPeerDevice->driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1631, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1632
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1633
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if device == peerDevice:
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1633, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1634
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1632
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1635
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_device == __pyx_v_peerDevice) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1636
 *         return err
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (__pyx_v_canAccessPeer[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1635
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1637
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1619
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceCanAccessPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1640
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeer(void *__pyx_v_dst, int __pyx_v_dstDevice, void const *__pyx_v_src, int __pyx_v_srcDevice, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_peerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyPeer", __pyx_f[0], 1640, 1, __PYX_ERR(0, 1640, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1644
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1644, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1645
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1646
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1645
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1647
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  __pyx_t_2 = ((__pyx_v_count > 0) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1648
 *         return err
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)             # <<<<<<<<<<<<<<
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 */
    __pyx_v_peerDevice = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_dstDevice);

    /* "cuda/_lib/ccudart/ccudart.pyx":1649
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)             # <<<<<<<<<<<<<<
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 */
    __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_srcDevice);

    /* "cuda/_lib/ccudart/ccudart.pyx":1650
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    __pyx_t_3 = ((__pyx_v_device == NULL) != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_peerDevice == NULL) != 0);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1651
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1651, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1652
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidDevice;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1650
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1653
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_peerDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1653, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1654
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1655
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = initPrimaryContext(device)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1655, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1656
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1654
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1657
 *             _setLastError(err)
 *             return err
 *         err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1657, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1658
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1659
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1659, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1660
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1658
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1661
 *             _setLastError(err)
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer(((CUdeviceptr)__pyx_v_dst), (__pyx_v_peerDevice[0]).primaryContext, ((CUdeviceptr)__pyx_v_src), (__pyx_v_device[0]).primaryContext, __pyx_v_count); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1661, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":1662
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1663
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *     return err
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1663, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1664
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1662
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1647
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1665
 *             _setLastError(err)
 *             return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1640
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1668
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeerAsync(void *__pyx_v_dst, int __pyx_v_dstDevice, void const *__pyx_v_src, int __pyx_v_srcDevice, size_t __pyx_v_count, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_peerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyPeerAsync", __pyx_f[0], 1668, 1, __PYX_ERR(0, 1668, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1672
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1672, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1673
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1674
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1673
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1675
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  __pyx_t_2 = ((__pyx_v_count > 0) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1676
 *         return err
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)             # <<<<<<<<<<<<<<
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 */
    __pyx_v_peerDevice = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_dstDevice);

    /* "cuda/_lib/ccudart/ccudart.pyx":1677
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)             # <<<<<<<<<<<<<<
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 */
    __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_srcDevice);

    /* "cuda/_lib/ccudart/ccudart.pyx":1678
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    __pyx_t_3 = ((__pyx_v_device == NULL) != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_peerDevice == NULL) != 0);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1679
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1679, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1680
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidDevice;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1678
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1681
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_peerDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1681, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1682
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1683
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = initPrimaryContext(device)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1683, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1684
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1682
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1685
 *             _setLastError(err)
 *             return err
 *         err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1685, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1686
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1687
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1687, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1688
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1686
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1689
 *             _setLastError(err)
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync(((CUdeviceptr)__pyx_v_dst), (__pyx_v_peerDevice[0]).primaryContext, ((CUdeviceptr)__pyx_v_src), (__pyx_v_device[0]).primaryContext, __pyx_v_count, ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1689, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":1690
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1691
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *     return err
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1691, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1692
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1690
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1675
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1693
 *             _setLastError(err)
 *             return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1668
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyPeerAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1696
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess(int __pyx_v_peerDevice, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_dev;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceEnablePeerAccess", __pyx_f[0], 1696, 1, __PYX_ERR(0, 1696, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1700
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1700, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1701
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1702
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1702, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1703
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1701
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1704
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1704, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1705
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1706
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1706, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1707
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1705
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1708
 *         _setLastError(err)
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_v_dev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context);

  /* "cuda/_lib/ccudart/ccudart.pyx":1709
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_2 = ((__pyx_v_dev == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1712
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)             # <<<<<<<<<<<<<<
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorIncompatibleDriverContext); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1712, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1713
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1709
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1714
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_v_dev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1715
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  __pyx_t_2 = ((__pyx_v_dev == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1716
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1715
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1717
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_dev); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1717, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1718
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1719
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1719, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1720
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1718
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1721
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess(__pyx_v_dev->primaryContext, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1721, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1722
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1723
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1723, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1722
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1724
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1696
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceEnablePeerAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1727
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceDisablePeerAccess(int __pyx_v_peerDevice) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_dev;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceDisablePeerAccess", __pyx_f[0], 1727, 1, __PYX_ERR(0, 1727, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1731
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1731, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1732
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1733
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1733, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1734
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1732
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1735
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1735, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1736
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1737
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1737, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1738
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1736
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1739
 *         _setLastError(err)
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_v_dev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context);

  /* "cuda/_lib/ccudart/ccudart.pyx":1740
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_2 = ((__pyx_v_dev == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1743
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)             # <<<<<<<<<<<<<<
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorIncompatibleDriverContext); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1743, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1744
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1740
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1745
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_v_dev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1746
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  __pyx_t_2 = ((__pyx_v_dev == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1747
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1746
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1748
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_dev); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1748, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1749
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1750
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1750, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1751
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1749
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1752
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess(__pyx_v_dev->primaryContext); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1752, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1753
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1754
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1754, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1753
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1755
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1727
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceDisablePeerAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1757
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmap, cudaExternalMemory_t __pyx_v_extMem, struct cudaExternalMemoryMipmappedArrayDesc const *__pyx_v_mipmapDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC __pyx_v__driver_mipmapDesc;
  cudaError_t __pyx_v_err_rt;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  unsigned PY_LONG_LONG __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  CUresult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedMipmappedArray", __pyx_f[0], 1757, 1, __PYX_ERR(0, 1757, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1759
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1759, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1761
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 */
  (void)(memset((&__pyx_v__driver_mipmapDesc), 0, (sizeof(__pyx_v__driver_mipmapDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1762
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 */
  __pyx_t_2 = (__pyx_v_mipmapDesc[0]).offset;
  __pyx_v__driver_mipmapDesc.offset = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1763
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.width;
  __pyx_v__driver_mipmapDesc.arrayDesc.Width = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1764
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.height;
  __pyx_v__driver_mipmapDesc.arrayDesc.Height = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1765
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth             # <<<<<<<<<<<<<<
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.depth;
  __pyx_v__driver_mipmapDesc.arrayDesc.Depth = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1766
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)             # <<<<<<<<<<<<<<
 *     if err_rt != cudaError.cudaSuccess:
 *         _setLastError(err_rt)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_mipmapDesc[0]).formatDesc), ((int *)(&__pyx_v__driver_mipmapDesc.arrayDesc.NumChannels)), (&__pyx_v__driver_mipmapDesc.arrayDesc.Format)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_v_err_rt = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1767
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err_rt)
 *         return err_rt
 */
  __pyx_t_4 = ((__pyx_v_err_rt != cudaSuccess) != 0);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1768
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:
 *         _setLastError(err_rt)             # <<<<<<<<<<<<<<
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err_rt); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1768, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1769
 *     if err_rt != cudaError.cudaSuccess:
 *         _setLastError(err_rt)
 *         return err_rt             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 */
    __pyx_r = __pyx_v_err_rt;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1767
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err_rt)
 *         return err_rt
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1770
 *         _setLastError(err_rt)
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 */
  __pyx_t_5 = (__pyx_v_mipmapDesc[0]).flags;
  __pyx_v__driver_mipmapDesc.arrayDesc.Flags = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1771
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_5 = (__pyx_v_mipmapDesc[0]).numLevels;
  __pyx_v__driver_mipmapDesc.numLevels = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1773
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 */
  __pyx_t_4 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1774
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1773
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1775
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_6 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray(((CUmipmappedArray *)__pyx_v_mipmap), ((CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_mipmapDesc)); if (unlikely(__pyx_t_6 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1775, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_6);

  /* "cuda/_lib/ccudart/ccudart.pyx":1776
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_4 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1777
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1777, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1776
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1778
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1757
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaExternalMemoryGetMappedMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1780
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *__pyx_v_pResDesc, cudaSurfaceObject_t __pyx_v_surfObject) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  long __pyx_v_channel_size;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetSurfaceObjectResourceDesc", __pyx_f[0], 1780, 1, __PYX_ERR(0, 1780, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1782
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1782, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1785
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1786
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1785
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1787
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)             # <<<<<<<<<<<<<<
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc((&__pyx_v__driver_pResDesc), ((CUsurfObject)__pyx_v_surfObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1787, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1788
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))             # <<<<<<<<<<<<<<
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 */
  (void)(memset(__pyx_v_pResDesc, 0, (sizeof(struct cudaResourceDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1789
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 */
  switch (__pyx_v__driver_pResDesc.resType) {
    case CU_RESOURCE_TYPE_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1790
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1791
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 */
    (__pyx_v_pResDesc[0]).res.array.array = ((cudaArray_t)__pyx_v__driver_pResDesc.res.array.hArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1789
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 */
    break;
    case CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1793
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeMipmappedArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1794
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 */
    (__pyx_v_pResDesc[0]).res.mipmap.mipmap = ((cudaMipmappedArray_t)__pyx_v__driver_pResDesc.res.mipmap.hMipmappedArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1792
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 */
    break;
    case CU_RESOURCE_TYPE_LINEAR:

    /* "cuda/_lib/ccudart/ccudart.pyx":1796
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeLinear;

    /* "cuda/_lib/ccudart/ccudart.pyx":1797
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 */
    (__pyx_v_pResDesc[0]).res.linear.devPtr = ((void *)__pyx_v__driver_pResDesc.res.linear.devPtr);

    /* "cuda/_lib/ccudart/ccudart.pyx":1798
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.linear.sizeInBytes;
    (__pyx_v_pResDesc[0]).res.linear.sizeInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1795
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 */
    break;
    case CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1800
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypePitch2D;

    /* "cuda/_lib/ccudart/ccudart.pyx":1801
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 */
    (__pyx_v_pResDesc[0]).res.pitch2D.devPtr = ((void *)__pyx_v__driver_pResDesc.res.pitch2D.devPtr);

    /* "cuda/_lib/ccudart/ccudart.pyx":1802
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.pitchInBytes;
    (__pyx_v_pResDesc[0]).res.pitch2D.pitchInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1803
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.width;
    (__pyx_v_pResDesc[0]).res.pitch2D.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1804
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height             # <<<<<<<<<<<<<<
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.height;
    (__pyx_v_pResDesc[0]).res.pitch2D.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1799
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1805
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 */
  switch (__pyx_v__driver_pResDesc.resType) {
    case CU_RESOURCE_TYPE_LINEAR:
    case CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1806
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
    __pyx_v_channel_size = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1807
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 */
    switch (__pyx_v__driver_pResDesc.res.linear.format) {
      case CU_AD_FORMAT_UNSIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1808
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1809
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
      __pyx_v_channel_size = 8;

      /* "cuda/_lib/ccudart/ccudart.pyx":1807
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 */
      break;
      case CU_AD_FORMAT_UNSIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1811
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1812
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 16             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
      __pyx_v_channel_size = 16;

      /* "cuda/_lib/ccudart/ccudart.pyx":1810
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_UNSIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1814
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1815
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 32             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
      __pyx_v_channel_size = 32;

      /* "cuda/_lib/ccudart/ccudart.pyx":1813
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1817
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1818
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 8             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
      __pyx_v_channel_size = 8;

      /* "cuda/_lib/ccudart/ccudart.pyx":1816
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 8
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1820
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1821
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 16             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
      __pyx_v_channel_size = 16;

      /* "cuda/_lib/ccudart/ccudart.pyx":1819
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1823
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1824
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 32             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 */
      __pyx_v_channel_size = 32;

      /* "cuda/_lib/ccudart/ccudart.pyx":1822
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_HALF:

      /* "cuda/_lib/ccudart/ccudart.pyx":1826
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1827
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 16             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 */
      __pyx_v_channel_size = 16;

      /* "cuda/_lib/ccudart/ccudart.pyx":1825
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_FLOAT:

      /* "cuda/_lib/ccudart/ccudart.pyx":1829
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1830
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 32             # <<<<<<<<<<<<<<
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 */
      __pyx_v_channel_size = 32;

      /* "cuda/_lib/ccudart/ccudart.pyx":1828
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_NV12:

      /* "cuda/_lib/ccudart/ccudart.pyx":1832
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindNV12             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         else:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindNV12;

      /* "cuda/_lib/ccudart/ccudart.pyx":1833
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *             channel_size = 8             # <<<<<<<<<<<<<<
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 */
      __pyx_v_channel_size = 8;

      /* "cuda/_lib/ccudart/ccudart.pyx":1831
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *             channel_size = 8
 */
      break;
      default:

      /* "cuda/_lib/ccudart/ccudart.pyx":1835
 *             channel_size = 8
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)             # <<<<<<<<<<<<<<
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 *         pResDesc[0].res.linear.desc.x = 0
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidChannelDescriptor); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1835, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1836
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.x = 0
 *         pResDesc[0].res.linear.desc.y = 0
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;
      break;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1837
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 *         pResDesc[0].res.linear.desc.x = 0             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.y = 0
 *         pResDesc[0].res.linear.desc.z = 0
 */
    (__pyx_v_pResDesc[0]).res.linear.desc.x = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1838
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 *         pResDesc[0].res.linear.desc.x = 0
 *         pResDesc[0].res.linear.desc.y = 0             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.z = 0
 *         pResDesc[0].res.linear.desc.w = 0
 */
    (__pyx_v_pResDesc[0]).res.linear.desc.y = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1839
 *         pResDesc[0].res.linear.desc.x = 0
 *         pResDesc[0].res.linear.desc.y = 0
 *         pResDesc[0].res.linear.desc.z = 0             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.w = 0
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 */
    (__pyx_v_pResDesc[0]).res.linear.desc.z = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1840
 *         pResDesc[0].res.linear.desc.y = 0
 *         pResDesc[0].res.linear.desc.z = 0
 *         pResDesc[0].res.linear.desc.w = 0             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 *             pResDesc[0].res.linear.desc.w = channel_size
 */
    (__pyx_v_pResDesc[0]).res.linear.desc.w = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1841
 *         pResDesc[0].res.linear.desc.z = 0
 *         pResDesc[0].res.linear.desc.w = 0
 *         if _driver_pResDesc.res.linear.numChannels >= 4:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 */
    __pyx_t_2 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 4) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1842
 *         pResDesc[0].res.linear.desc.w = 0
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 *             pResDesc[0].res.linear.desc.w = channel_size             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 *             pResDesc[0].res.linear.desc.z = channel_size
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.w = __pyx_v_channel_size;

      /* "cuda/_lib/ccudart/ccudart.pyx":1841
 *         pResDesc[0].res.linear.desc.z = 0
 *         pResDesc[0].res.linear.desc.w = 0
 *         if _driver_pResDesc.res.linear.numChannels >= 4:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1843
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 */
    __pyx_t_2 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 3) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1844
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 *             pResDesc[0].res.linear.desc.z = channel_size             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 *             pResDesc[0].res.linear.desc.y = channel_size
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.z = __pyx_v_channel_size;

      /* "cuda/_lib/ccudart/ccudart.pyx":1843
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1845
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 */
    __pyx_t_2 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 2) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1846
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 *             pResDesc[0].res.linear.desc.y = channel_size             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 *             pResDesc[0].res.linear.desc.x = channel_size
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.y = __pyx_v_channel_size;

      /* "cuda/_lib/ccudart/ccudart.pyx":1845
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1847
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 */
    __pyx_t_2 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 1) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1848
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 *             pResDesc[0].res.linear.desc.x = channel_size             # <<<<<<<<<<<<<<
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.x = __pyx_v_channel_size;

      /* "cuda/_lib/ccudart/ccudart.pyx":1847
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1849
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 */
    __pyx_t_5 = ((__pyx_v__driver_pResDesc.res.linear.numChannels < 1) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 5) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1850
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)             # <<<<<<<<<<<<<<
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidChannelDescriptor); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1850, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1851
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1849
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1805
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1853
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1854
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1854, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1853
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1855
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1780
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetSurfaceObjectResourceDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1857
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaKernelNodeParams *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_KERNEL_NODE_PARAMS __pyx_v__driver_pNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  void **__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphKernelNodeGetParams", __pyx_f[0], 1857, 1, __PYX_ERR(0, 1857, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1859
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS _driver_pNodeParams
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1859, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1862
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS _driver_pNodeParams
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1863
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)
 *     pNodeParams[0].func = <void*>_driver_pNodeParams.func
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1862
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS _driver_pNodeParams
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1864
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)             # <<<<<<<<<<<<<<
 *     pNodeParams[0].func = <void*>_driver_pNodeParams.func
 *     pNodeParams[0].gridDim.x = _driver_pNodeParams.gridDimX
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams(((CUgraphNode)__pyx_v_node), (&__pyx_v__driver_pNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1864, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1865
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)
 *     pNodeParams[0].func = <void*>_driver_pNodeParams.func             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.x = _driver_pNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = _driver_pNodeParams.gridDimY
 */
  (__pyx_v_pNodeParams[0]).func = ((void *)__pyx_v__driver_pNodeParams.func);

  /* "cuda/_lib/ccudart/ccudart.pyx":1866
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams(<ccuda.CUgraphNode>node, &_driver_pNodeParams)
 *     pNodeParams[0].func = <void*>_driver_pNodeParams.func
 *     pNodeParams[0].gridDim.x = _driver_pNodeParams.gridDimX             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.y = _driver_pNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = _driver_pNodeParams.gridDimZ
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.gridDimX;
  (__pyx_v_pNodeParams[0]).gridDim.x = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1867
 *     pNodeParams[0].func = <void*>_driver_pNodeParams.func
 *     pNodeParams[0].gridDim.x = _driver_pNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = _driver_pNodeParams.gridDimY             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.z = _driver_pNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = _driver_pNodeParams.blockDimX
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.gridDimY;
  (__pyx_v_pNodeParams[0]).gridDim.y = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1868
 *     pNodeParams[0].gridDim.x = _driver_pNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = _driver_pNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = _driver_pNodeParams.gridDimZ             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.x = _driver_pNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = _driver_pNodeParams.blockDimY
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.gridDimZ;
  (__pyx_v_pNodeParams[0]).gridDim.z = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1869
 *     pNodeParams[0].gridDim.y = _driver_pNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = _driver_pNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = _driver_pNodeParams.blockDimX             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.y = _driver_pNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = _driver_pNodeParams.blockDimZ
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.blockDimX;
  (__pyx_v_pNodeParams[0]).blockDim.x = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1870
 *     pNodeParams[0].gridDim.z = _driver_pNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = _driver_pNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = _driver_pNodeParams.blockDimY             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.z = _driver_pNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.blockDimY;
  (__pyx_v_pNodeParams[0]).blockDim.y = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1871
 *     pNodeParams[0].blockDim.x = _driver_pNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = _driver_pNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = _driver_pNodeParams.blockDimZ             # <<<<<<<<<<<<<<
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = _driver_pNodeParams.kernelParams
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.blockDimZ;
  (__pyx_v_pNodeParams[0]).blockDim.z = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1872
 *     pNodeParams[0].blockDim.y = _driver_pNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = _driver_pNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes             # <<<<<<<<<<<<<<
 *     pNodeParams[0].kernelParams = _driver_pNodeParams.kernelParams
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.sharedMemBytes;
  (__pyx_v_pNodeParams[0]).sharedMemBytes = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1873
 *     pNodeParams[0].blockDim.z = _driver_pNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = _driver_pNodeParams.kernelParams             # <<<<<<<<<<<<<<
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 * 
 */
  __pyx_t_5 = __pyx_v__driver_pNodeParams.kernelParams;
  (__pyx_v_pNodeParams[0]).kernelParams = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1874
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = _driver_pNodeParams.kernelParams
 *     pNodeParams[0].extra = _driver_pNodeParams.extra             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_5 = __pyx_v__driver_pNodeParams.extra;
  (__pyx_v_pNodeParams[0]).extra = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1876
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1877
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1877, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1876
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1878
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1857
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1880
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer(void **__pyx_v_devPtr, cudaExternalMemory_t __pyx_v_extMem, struct cudaExternalMemoryBufferDesc const *__pyx_v_bufferDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_BUFFER_DESC __pyx_v__driver_bufferDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  unsigned PY_LONG_LONG __pyx_t_2;
  unsigned int __pyx_t_3;
  int __pyx_t_4;
  CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedBuffer", __pyx_f[0], 1880, 1, __PYX_ERR(0, 1880, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1882
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1882, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1884
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size
 */
  (void)(memset((&__pyx_v__driver_bufferDesc), 0, (sizeof(__pyx_v__driver_bufferDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1885
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 *     _driver_bufferDesc.offset = bufferDesc[0].offset             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.size = bufferDesc[0].size
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 */
  __pyx_t_2 = (__pyx_v_bufferDesc[0]).offset;
  __pyx_v__driver_bufferDesc.offset = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1886
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 * 
 */
  __pyx_t_2 = (__pyx_v_bufferDesc[0]).size;
  __pyx_v__driver_bufferDesc.size = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1887
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size
 *     _driver_bufferDesc.flags = bufferDesc[0].flags             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_3 = (__pyx_v_bufferDesc[0]).flags;
  __pyx_v__driver_bufferDesc.flags = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1889
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 */
  __pyx_t_4 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1890
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1889
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1891
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer(((CUdeviceptr *)__pyx_v_devPtr), ((CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_bufferDesc)); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1891, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":1892
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_4 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1893
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1893, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1892
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1894
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1880
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaExternalMemoryGetMappedBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1896
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory(cudaExternalMemory_t *__pyx_v_extMem_out, struct cudaExternalMemoryHandleDesc const *__pyx_v_memHandleDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_HANDLE_DESC __pyx_v__driver_memHandleDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  void *__pyx_t_4;
  void const *__pyx_t_5;
  void const *__pyx_t_6;
  unsigned PY_LONG_LONG __pyx_t_7;
  unsigned int __pyx_t_8;
  CUresult __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaImportExternalMemory", __pyx_f[0], 1896, 1, __PYX_ERR(0, 1896, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1898
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1898, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1900
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))             # <<<<<<<<<<<<<<
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 */
  (void)(memset((&__pyx_v__driver_memHandleDesc), 0, (sizeof(__pyx_v__driver_memHandleDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1902
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueFd) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1903
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":1904
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 */
    __pyx_t_3 = (__pyx_v_memHandleDesc[0]).handle.fd;
    __pyx_v__driver_memHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1902
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1905
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueWin32) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1906
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":1907
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1908
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1905
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1909
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueWin32Kmt) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1910
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1911
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1912
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1909
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1913
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D12Heap) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1914
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP;

    /* "cuda/_lib/ccudart/ccudart.pyx":1915
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1916
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1913
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1917
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D12Resource) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1918
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1919
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1920
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1917
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1921
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D11Resource) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1922
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1923
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1924
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1921
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1925
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D11ResourceKmt) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1926
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1927
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1928
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1925
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1929
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 */
  __pyx_t_2 = (((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeNvSciBuf) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1930
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF;

    /* "cuda/_lib/ccudart/ccudart.pyx":1931
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject             # <<<<<<<<<<<<<<
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 */
    __pyx_t_6 = (__pyx_v_memHandleDesc[0]).handle.nvSciBufObject;
    __pyx_v__driver_memHandleDesc.handle.nvSciBufObject = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":1929
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 */
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1932
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size             # <<<<<<<<<<<<<<
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 */
  __pyx_t_7 = (__pyx_v_memHandleDesc[0]).size;
  __pyx_v__driver_memHandleDesc.size = __pyx_t_7;

  /* "cuda/_lib/ccudart/ccudart.pyx":1933
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_8 = (__pyx_v_memHandleDesc[0]).flags;
  __pyx_v__driver_memHandleDesc.flags = __pyx_t_8;

  /* "cuda/_lib/ccudart/ccudart.pyx":1935
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1936
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1935
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1937
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_9 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory(((CUexternalMemory *)__pyx_v_extMem_out), (&__pyx_v__driver_memHandleDesc)); if (unlikely(__pyx_t_9 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1937, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_9);

  /* "cuda/_lib/ccudart/ccudart.pyx":1938
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1939
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1939, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1938
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1940
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1896
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaImportExternalMemory", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1942
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject(cudaSurfaceObject_t *__pyx_v_pSurfObject, struct cudaResourceDesc const *__pyx_v_pResDesc) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateSurfaceObject", __pyx_f[0], 1942, 1, __PYX_ERR(0, 1942, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1944
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1944, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1945
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1946
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1945
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1948
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))             # <<<<<<<<<<<<<<
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v__driver_pResDesc), 0, (sizeof(__pyx_v__driver_pResDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1949
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1949, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1950
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1951
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1951, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1952
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1950
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1954
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate(((CUsurfObject *)__pyx_v_pSurfObject), (&__pyx_v__driver_pResDesc)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1954, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1955
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1956
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1956, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1955
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1957
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1942
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateSurfaceObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1959
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *__pyx_v_pResDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectResourceDesc", __pyx_f[0], 1959, 1, __PYX_ERR(0, 1959, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1961
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1961, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1962
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1963
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1962
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1965
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))             # <<<<<<<<<<<<<<
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v__driver_pResDesc), 0, (sizeof(__pyx_v__driver_pResDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1966
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1966, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1967
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1968
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1968, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1969
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1967
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1971
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v__driver_pResDesc), ((CUtexObject)__pyx_v_texObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1971, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1972
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1973
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1973, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1972
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1974
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaProfilerInitialize(const char* configFile, const char* outputFile, cudaOutputMode_t outputMode) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1959
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectResourceDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1976
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerInitialize(const char* configFile, const char* outputFile, cudaOutputMode_t outputMode) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerInitialize(char const *__pyx_v_configFile, char const *__pyx_v_outputFile, cudaOutputMode_t __pyx_v_outputMode) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaProfilerInitialize", __pyx_f[0], 1976, 1, __PYX_ERR(0, 1976, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1978
 * cdef cudaError_t _cudaProfilerInitialize(const char* configFile, const char* outputFile, cudaOutputMode_t outputMode) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1978, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1979
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1980
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1979
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1981
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuProfilerInitialize(__pyx_v_configFile, __pyx_v_outputFile, ((CUoutput_mode)__pyx_v_outputMode)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1981, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1982
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1983
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1983, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1982
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerInitialize(configFile, outputFile, <ccuda.CUoutput_mode>outputMode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1984
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1976
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerInitialize(const char* configFile, const char* outputFile, cudaOutputMode_t outputMode) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaProfilerInitialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1986
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerPresentFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_cudaEglFrame __pyx_v_eglframe, cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaEGLStreamProducerPresentFrame", __pyx_f[0], 1986, 1, __PYX_ERR(0, 1986, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1988
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1988, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1989
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1990
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1989
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1992
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame((&__pyx_v_cueglFrame), __pyx_v_eglframe); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1992, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1993
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1994
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1994, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1995
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1993
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1996
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), __pyx_v_cueglFrame, __pyx_v_pStream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1996, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1997
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1998
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1998, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1997
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1999
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1986
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerPresentFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2001
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerReturnFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_cudaEglFrame *__pyx_v_eglframe, cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaEGLStreamProducerReturnFrame", __pyx_f[0], 2001, 1, __PYX_ERR(0, 2001, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2003
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2003, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2004
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if eglframe == NULL:
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2005
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2004
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if eglframe == NULL:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2006
 *     if err != cudaSuccess:
 *         return err
 *     if eglframe == NULL:             # <<<<<<<<<<<<<<
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 */
  __pyx_t_2 = ((__pyx_v_eglframe == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2007
 *         return err
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
    __pyx_v_err = cudaErrorInvalidResourceHandle;

    /* "cuda/_lib/ccudart/ccudart.pyx":2008
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2008, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2009
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2006
 *     if err != cudaSuccess:
 *         return err
 *     if eglframe == NULL:             # <<<<<<<<<<<<<<
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2011
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), (&__pyx_v_cueglFrame), __pyx_v_pStream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2011, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2012
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2013
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2013, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2014
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2012
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2015
 *         _setLastError(err)
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame(__pyx_v_eglframe, __pyx_v_cueglFrame); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2015, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2016
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2017
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2017, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2018
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2016
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2019
 *         _setLastError(err)
 *         return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2001
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerReturnFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2021
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedEglFrame(__pyx_t_4cuda_7ccudart_cudaEglFrame *__pyx_v_eglFrame, cudaGraphicsResource_t __pyx_v_resource, unsigned int __pyx_v_index, unsigned int __pyx_v_mipLevel) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphicsResourceGetMappedEglFrame", __pyx_f[0], 2021, 1, __PYX_ERR(0, 2021, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2023
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2024
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2025
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2024
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2027
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_cueglFrame), 0, (sizeof(__pyx_v_cueglFrame))));

  /* "cuda/_lib/ccudart/ccudart.pyx":2028
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame((&__pyx_v_cueglFrame), ((CUgraphicsResource)__pyx_v_resource), __pyx_v_index, __pyx_v_mipLevel); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2028, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2029
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2030
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2030, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2031
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2029
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2032
 *         _setLastError(err)
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame(__pyx_v_eglFrame, __pyx_v_cueglFrame); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2032, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2033
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2034
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2034, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2035
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2033
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2036
 *         _setLastError(err)
 *         return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2021
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsResourceGetMappedEglFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2038
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaErrorNotSupported
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUSetVDPAUDevice(CYTHON_UNUSED int __pyx_v_device, CYTHON_UNUSED __pyx_t_4cuda_7ccudart_VdpDevice __pyx_v_vdpDevice, CYTHON_UNUSED __pyx_t_4cuda_7ccudart_VdpGetProcAddress *__pyx_v_vdpGetProcAddress) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaVDPAUSetVDPAUDevice", __pyx_f[0], 2038, 1, __PYX_ERR(0, 2038, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2039
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaErrorNotSupported             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = cudaErrorNotSupported;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2038
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaErrorNotSupported
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaVDPAUSetVDPAUDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2041
 *     return cudaErrorNotSupported
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *__pyx_v_memoryRequirements, cudaArray_t __pyx_v_array, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_MEMORY_REQUIREMENTS __pyx_v_driverMemoryRequirements;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaArrayGetMemoryRequirements", __pyx_f[0], 2041, 1, __PYX_ERR(0, 2041, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2044
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_memoryRequirements == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2045
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2045, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2046
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2044
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2048
 *         return cudaErrorInvalidValue
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:
 */
  (void)(memset(__pyx_v_memoryRequirements, 0, (sizeof((__pyx_v_memoryRequirements[0])))));

  /* "cuda/_lib/ccudart/ccudart.pyx":2049
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements((&__pyx_v_driverMemoryRequirements), ((CUarray)__pyx_v_array), __pyx_v_device); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2049, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2050
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2051
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2051, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2052
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2050
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2054
 *         return err
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size             # <<<<<<<<<<<<<<
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.size;
  (__pyx_v_memoryRequirements[0]).size = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":2055
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.alignment;
  (__pyx_v_memoryRequirements[0]).alignment = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":2056
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2041
 *     return cudaErrorNotSupported
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetMemoryRequirements", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2058
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *__pyx_v_memoryRequirements, cudaMipmappedArray_t __pyx_v_mipmap, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_MEMORY_REQUIREMENTS __pyx_v_driverMemoryRequirements;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMipmappedArrayGetMemoryRequirements", __pyx_f[0], 2058, 1, __PYX_ERR(0, 2058, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2061
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_memoryRequirements == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2062
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2062, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2063
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2061
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2065
 *         return cudaErrorInvalidValue
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:
 */
  (void)(memset(__pyx_v_memoryRequirements, 0, (sizeof((__pyx_v_memoryRequirements[0])))));

  /* "cuda/_lib/ccudart/ccudart.pyx":2066
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements((&__pyx_v_driverMemoryRequirements), ((CUmipmappedArray)__pyx_v_mipmap), __pyx_v_device); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2066, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2067
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2068
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2068, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2069
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2067
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2071
 *         return err
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size             # <<<<<<<<<<<<<<
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.size;
  (__pyx_v_memoryRequirements[0]).size = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":2072
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.alignment;
  (__pyx_v_memoryRequirements[0]).alignment = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":2073
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2058
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMipmappedArrayGetMemoryRequirements", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2075
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetAttribute(cudaStream_t __pyx_v_hStream, enum __pyx_t_4cuda_7ccudart_cudaStreamAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue *__pyx_v_value_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamGetAttribute", __pyx_f[0], 2075, 1, __PYX_ERR(0, 2075, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2077
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2077, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2078
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2079
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2078
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2080
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute(((CUstream)__pyx_v_hStream), ((CUstreamAttrID)__pyx_v_attr), ((CUstreamAttrValue *)__pyx_v_value_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2080, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2081
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2082
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2082, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2081
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2083
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2075
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2085
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSetAttribute(cudaStream_t __pyx_v_hStream, enum __pyx_t_4cuda_7ccudart_cudaStreamAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue const *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamSetAttribute", __pyx_f[0], 2085, 1, __PYX_ERR(0, 2085, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2087
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2087, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2088
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2089
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2088
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2090
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute(((CUstream)__pyx_v_hStream), ((CUstreamAttrID)__pyx_v_attr), ((CUstreamAttrValue *)__pyx_v_value)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2090, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2091
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2092
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2092, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2091
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2093
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2085
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2095
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetAttribute(cudaGraphNode_t __pyx_v_hNode, enum __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue *__pyx_v_value_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphKernelNodeGetAttribute", __pyx_f[0], 2095, 1, __PYX_ERR(0, 2095, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2097
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2097, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2098
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2099
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2098
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2100
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute(((CUgraphNode)__pyx_v_hNode), ((CUkernelNodeAttrID)__pyx_v_attr), ((CUkernelNodeAttrValue *)__pyx_v_value_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2100, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2101
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2102
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2102, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2101
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2103
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2095
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2105
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetAttribute(cudaGraphNode_t __pyx_v_hNode, enum __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue const *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphKernelNodeSetAttribute", __pyx_f[0], 2105, 1, __PYX_ERR(0, 2105, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2107
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2107, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2108
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2109
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2108
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2110
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute(((CUgraphNode)__pyx_v_hNode), ((CUkernelNodeAttrID)__pyx_v_attr), ((CUkernelNodeAttrValue *)__pyx_v_value)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2110, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2111
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2112
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2112, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2111
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2113
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2105
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
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},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "ccudart",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1137, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global = ((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_cudaMemcpy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreate, "cudaError_t (cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreate, "cudaError_t (cudaEvent_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventQuery", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventQuery, "cudaError_t (cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateChannelDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateChannelDesc, "struct cudaChannelFormatDesc (int, int, int, int, enum cudaChannelFormatKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDriverGetVersion", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDriverGetVersion, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaRuntimeGetVersion", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaRuntimeGetVersion, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetTexture1DLinearMaxWidth", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetTexture1DLinearMaxWidth, "cudaError_t (size_t *, struct cudaChannelFormatDesc const *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocHost, "cudaError_t (void **, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocPitch", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocPitch, "cudaError_t (void **, size_t *, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, struct cudaExtent, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2D, "cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DAsync, "cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyAsync, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode1D, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams1D, "cudaError_t (cudaGraphNode_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams1D, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDriverEntryPoint", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDriverEntryPoint, "cudaError_t (char const *, void **, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemsetNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemsetNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemsetNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemsetNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncGetAttributes, "cudaError_t (struct cudaFuncAttributes *, void const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3D, "cudaError_t (struct cudaPitchedPtr *, struct cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc3DArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3DArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, struct cudaExtent, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetErrorString", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetErrorString, "char const *(cudaError_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamAddCallback", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAddCallback, "cudaError_t (cudaStream_t, cudaStreamCallback_t, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetCaptureInfo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetCaptureInfo_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo_v2, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaImportExternalSemaphore", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalSemaphore, "cudaError_t (cudaExternalSemaphore_t *, struct cudaExternalSemaphoreHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSignalExternalSemaphoresAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync, "cudaError_t (cudaExternalSemaphore_t const *, struct cudaExternalSemaphoreSignalParams const *, unsigned int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaWaitExternalSemaphoresAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync, "cudaError_t (cudaExternalSemaphore_t const *, struct cudaExternalSemaphoreWaitParams const *, unsigned int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetInfo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo, "cudaError_t (struct cudaChannelFormatDesc *, struct cudaExtent *, unsigned int *, cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray, "cudaError_t (void *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync, "cudaError_t (void *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray, "cudaError_t (void *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync, "cudaError_t (void *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaPointerGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes, "cudaError_t (struct cudaPointerAttributes *, void const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceFlags, "cudaError_t (unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3D, "cudaError_t (struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync, "cudaError_t (struct cudaMemcpy3DParms const *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolSetAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess, "cudaError_t (cudaMemPool_t, struct cudaMemAccessDesc const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceReset", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceReset, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaThreadExit", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaThreadExit, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetLastError", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetLastError, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaPeekAtLastError", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPeekAtLastError, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDevice, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDevice, "cudaError_t (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceProperties, "cudaError_t (struct cudaDeviceProp *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaChooseDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice, "cudaError_t (int *, struct cudaDeviceProp const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetChannelDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc, "cudaError_t (struct cudaChannelFormatDesc *, cudaArray_const_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateTextureObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject, "cudaError_t (cudaTextureObject_t *, struct cudaResourceDesc const *, struct cudaTextureDesc const *, struct cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateTextureObject_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject_v2, "cudaError_t (cudaTextureObject_t *, struct cudaResourceDesc const *, struct cudaTextureDesc_v2 const *, struct cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectTextureDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc, "cudaError_t (struct cudaTextureDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectTextureDesc_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc_v2, "cudaError_t (struct cudaTextureDesc_v2 *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceViewDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc, "cudaError_t (struct cudaResourceViewDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetExportTable", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable, "cudaError_t (void const **, cudaUUID_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer, "cudaError_t (struct cudaMemcpy3DPeerParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeerAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync, "cudaError_t (struct cudaMemcpy3DPeerParms const *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaPitchedPtr", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPitchedPtr, "struct cudaPitchedPtr (void *, size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaPos", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPos, "struct cudaPos (size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaExtent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaExtent, "struct cudaExtent (size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDoubleForDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForDevice, "cudaError_t (double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDoubleForHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForHost, "cudaError_t (double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDeviceFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDeviceFlags, "cudaError_t (unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemAllocNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemAllocNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemAllocNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemFreeNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams, "cudaError_t (cudaGraphNode_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemAdvise", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise, "cudaError_t (void const *, size_t, enum cudaMemoryAdvise, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemRangeGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute, "cudaError_t (void *, size_t, enum cudaMemRangeAttribute, void const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemRangeGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttributes, "cudaError_t (void **, size_t *, enum cudaMemRangeAttribute *, size_t, void const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceCount", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceCount, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetAttribute, "cudaError_t (int *, enum cudaDeviceAttr, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetSharedMemConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig, "cudaError_t (enum cudaSharedMemConfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetByPCIBusId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId, "cudaError_t (int *, char const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetPCIBusId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetPCIBusId, "cudaError_t (char *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetP2PAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetP2PAttribute, "cudaError_t (int *, enum cudaDeviceP2PAttr, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetSparseProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetSparseProperties, "cudaError_t (struct cudaArraySparseProperties *, cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMipmappedArrayGetSparseProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties, "cudaError_t (struct cudaArraySparseProperties *, cudaMipmappedArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceCanAccessPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer, "cudaError_t (int *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeer, "cudaError_t (void *, int, void const *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyPeerAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeerAsync, "cudaError_t (void *, int, void const *, int, size_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceEnablePeerAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess, "cudaError_t (int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceDisablePeerAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceDisablePeerAccess, "cudaError_t (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaExternalMemoryGetMappedMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, cudaExternalMemory_t, struct cudaExternalMemoryMipmappedArrayDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetSurfaceObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc, "cudaError_t (struct cudaResourceDesc *, cudaSurfaceObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaKernelNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaExternalMemoryGetMappedBuffer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer, "cudaError_t (void **, cudaExternalMemory_t, struct cudaExternalMemoryBufferDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaImportExternalMemory", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory, "cudaError_t (cudaExternalMemory_t *, struct cudaExternalMemoryHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateSurfaceObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject, "cudaError_t (cudaSurfaceObject_t *, struct cudaResourceDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc, "cudaError_t (struct cudaResourceDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaProfilerInitialize", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerInitialize, "cudaError_t (char const *, char const *, cudaOutputMode_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerPresentFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerPresentFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_cudaEglFrame, cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerReturnFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerReturnFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_cudaEglFrame *, cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsResourceGetMappedEglFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedEglFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglFrame *, cudaGraphicsResource_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaVDPAUSetVDPAUDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUSetVDPAUDevice, "cudaError_t (int, __pyx_t_4cuda_7ccudart_VdpDevice, __pyx_t_4cuda_7ccudart_VdpGetProcAddress *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetMemoryRequirements", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetMemoryRequirements, "cudaError_t (struct cudaArrayMemoryRequirements *, cudaArray_t, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMipmappedArrayGetMemoryRequirements", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetMemoryRequirements, "cudaError_t (struct cudaArrayMemoryRequirements *, cudaMipmappedArray_t, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetAttribute, "cudaError_t (cudaStream_t, enum __pyx_t_4cuda_7ccudart_cudaStreamAttrID, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSetAttribute, "cudaError_t (cudaStream_t, enum __pyx_t_4cuda_7ccudart_cudaStreamAttrID, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetAttribute, "cudaError_t (cudaGraphNode_t, enum __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetAttribute, "cudaError_t (cudaGraphNode_t, enum __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cuda._lib.ccudart.utils"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = __Pyx_ImportType(__pyx_t_1, "cuda._lib.ccudart.utils", "cudaPythonGlobal", sizeof(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal), __PYX_GET_STRUCT_ALIGNMENT(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal),
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = (struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal*)__Pyx_GetVtable(__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal->tp_dict); if (unlikely(!__pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal)) __PYX_ERR(1, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cuda.ccuda"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction(__pyx_t_1, "cuTexObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "cuTexObjectGetResourceViewDesc", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc, "CUresult (CUDA_RESOURCE_VIEW_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cuda.ccudart"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction(__pyx_t_1, "cudaDeviceReset", (void (**)(void))&__pyx_f_4cuda_7ccudart_cudaDeviceReset, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cuda._cuda.ccuda"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGetErrorString", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString, "CUresult (CUresult, char const **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDriverGetVersion", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion, "CUresult (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetTexture1DLinearMaxWidth", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth, "CUresult (size_t *, CUarray_format, unsigned int, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute, "CUresult (int *, CUdevice_attribute, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDevicePrimaryCtxSetFlags_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2, "CUresult (CUdevice, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDevicePrimaryCtxGetState", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState, "CUresult (CUdevice, unsigned int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxSetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent, "CUresult (CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxGetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent, "CUresult (CUcontext *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxGetDevice", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice, "CUresult (CUdevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags, "CUresult (unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxSetSharedMemConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig, "CUresult (CUsharedconfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetByPCIBusId", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId, "CUresult (CUdevice *, char const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetPCIBusId", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId, "CUresult (char *, int, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemcpyPeer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer, "CUresult (CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemcpyPeerAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync, "CUresult (CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuArrayGetSparseProperties", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties, "CUresult (CUDA_ARRAY_SPARSE_PROPERTIES *, CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMipmappedArrayGetSparseProperties", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties, "CUresult (CUDA_ARRAY_SPARSE_PROPERTIES *, CUmipmappedArray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuArrayGetMemoryRequirements", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements, "CUresult (CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUarray, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMipmappedArrayGetMemoryRequirements", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements, "CUresult (CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUmipmappedArray, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuArray3DGetDescriptor_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2, "CUresult (CUDA_ARRAY3D_DESCRIPTOR *, CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemPoolSetAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess, "CUresult (CUmemoryPool, CUmemAccessDesc const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemAdvise", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise, "CUresult (CUdeviceptr, size_t, CUmem_advise, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemRangeGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute, "CUresult (void *, size_t, CUmem_range_attribute, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuMemRangeGetAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes, "CUresult (void **, size_t *, CUmem_range_attribute *, size_t, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuPointerGetAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes, "CUresult (unsigned int, CUpointer_attribute *, void **, CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuStreamCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate, "CUresult (CUstream *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuStreamGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute, "CUresult (CUstream, CUstreamAttrID, CUstreamAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuStreamSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute, "CUresult (CUstream, CUstreamAttrID, CUstreamAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuEventCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate, "CUresult (CUevent *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuEventQuery", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery, "CUresult (CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuImportExternalMemory", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory, "CUresult (CUexternalMemory *, CUDA_EXTERNAL_MEMORY_HANDLE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuExternalMemoryGetMappedBuffer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer, "CUresult (CUdeviceptr *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_BUFFER_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuExternalMemoryGetMappedMipmappedArray", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray, "CUresult (CUmipmappedArray *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuImportExternalSemaphore", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore, "CUresult (CUexternalSemaphore *, CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuSignalExternalSemaphoresAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync, "CUresult (CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuWaitExternalSemaphoresAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync, "CUresult (CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuFuncGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute, "CUresult (int *, CUfunction_attribute, CUfunction)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphKernelNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams, "CUresult (CUgraphNode, CUDA_KERNEL_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphAddMemcpyNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMCPY3D const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphMemcpyNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams, "CUresult (CUgraphNode, CUDA_MEMCPY3D *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphMemcpyNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams, "CUresult (CUgraphNode, CUDA_MEMCPY3D const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphAddMemsetNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMSET_NODE_PARAMS const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphAddMemAllocNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEM_ALLOC_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphMemAllocNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams, "CUresult (CUgraphNode, CUDA_MEM_ALLOC_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphMemFreeNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams, "CUresult (CUgraphNode, CUdeviceptr *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphExecMemcpyNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_MEMCPY3D const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphExecMemsetNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphKernelNodeGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute, "CUresult (CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphKernelNodeSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute, "CUresult (CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuTexObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate, "CUresult (CUtexObject *, CUDA_RESOURCE_DESC const *, CUDA_TEXTURE_DESC const *, CUDA_RESOURCE_VIEW_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuTexObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuTexObjectGetTextureDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc, "CUresult (CUDA_TEXTURE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuSurfObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate, "CUresult (CUsurfObject *, CUDA_RESOURCE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuSurfObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUsurfObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceCanAccessPeer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer, "CUresult (int *, CUdevice, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxEnablePeerAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess, "CUresult (CUcontext, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxDisablePeerAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess, "CUresult (CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetP2PAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute, "CUresult (int *, CUdevice_P2PAttribute, CUdevice, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGetProcAddress", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress, "CUresult (char const *, void **, int, cuuint64_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGetExportTable", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable, "CUresult (void const **, CUuuid const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuProfilerInitialize", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerInitialize, "CUresult (char const *, char const *, CUoutput_mode)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuEGLStreamProducerPresentFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame, CUstream *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuEGLStreamProducerReturnFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame *, CUstream *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuGraphicsResourceGetMappedEglFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglFrame *, CUgraphicsResource, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cuda._lib.ccudart.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction(__pyx_t_1, "initPrimaryContext", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext, "cudaError_t (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "resetPrimaryContext", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext, "cudaError_t (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "globalGetInstance", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance, "struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *(void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_setLastError", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError, "cudaError_t (cudaError_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getDescInfo", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo, "cudaError_t (struct cudaChannelFormatDesc const *, int *, CUarray_format *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "streamAddCallbackCommon", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon, "cudaError_t (cudaStream_t, cudaStreamCallback_t, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "streamGetCaptureInfoCommon", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getChannelFormatDescFromDriverDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc, "cudaError_t (struct cudaChannelFormatDesc *, size_t *, size_t *, size_t *, CUDA_ARRAY3D_DESCRIPTOR_v2 const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getChannelDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc, "cudaError_t (cudaArray_const_t, struct cudaChannelFormatDesc *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getDriverResDescFromResDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc, "cudaError_t (CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *, CUDA_TEXTURE_DESC *, struct cudaTextureDesc_v2 const *, CUDA_RESOURCE_VIEW_DESC *, struct cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getResDescFromDriverResDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc, "cudaError_t (struct cudaResourceDesc *, CUDA_RESOURCE_DESC const *, struct cudaTextureDesc_v2 *, CUDA_TEXTURE_DESC const *, struct cudaResourceViewDesc *, CUDA_RESOURCE_VIEW_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "copy1DConvertTo3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "toDriverMemsetNodeParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams, "void (struct cudaMemsetParams const *, CUDA_MEMSET_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "toDriverMemCopy3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams, "cudaError_t (struct cudaMemcpy3DParms const *, CUDA_MEMCPY3D *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "mallocArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpy2DToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray, "cudaError_t (cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpyDispatch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "mallocHost", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost, "cudaError_t (size_t, void **, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "mallocPitch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch, "cudaError_t (size_t, size_t, size_t, void **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "mallocMipmappedArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpy2DPtr", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr, "cudaError_t (char *, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpy3D", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D, "cudaError_t (struct cudaMemcpy3DParms const *, bool, int, int, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpyAsyncDispatch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "toCudartMemCopy3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams, "cudaError_t (CUDA_MEMCPY3D_v2 const *, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpy2DFromArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray, "cudaError_t (char *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpy2DArrayToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memset3DPtr", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpyToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray, "cudaError_t (cudaArray_t, size_t, size_t, char const *, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpyFromArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray, "cudaError_t (char *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "memcpyArrayToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "toDriverCudaResourceDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc, "cudaError_t (CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getDriverEglFrame", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame, "cudaError_t (__pyx_t_4cuda_5ccuda_CUeglFrame *, __pyx_t_4cuda_7ccudart_cudaEglFrame)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "getRuntimeEglFrame", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglFrame *, __pyx_t_4cuda_5ccuda_CUeglFrame)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initccudart(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initccudart(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_ccudart(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_ccudart(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        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, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    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)
#endif
#endif
{
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  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;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__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");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_ccudart(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("ccudart", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_cuda___lib__ccudart__ccudart) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "cuda._lib.ccudart.ccudart")) {
      if (unlikely(PyDict_SetItemString(modules, "cuda._lib.ccudart.ccudart", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_init_code();
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_ccudart(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":15
 * cimport cuda._cuda.ccuda as ccuda
 * 
 * cdef cudaPythonGlobal m_global = globalGetInstance()             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global));
  __Pyx_DECREF_SET(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, ((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1
 * # Copyright 2021-2022 NVIDIA Corporation.  All rights reserved.             # <<<<<<<<<<<<<<
 * #
 * # Please refer to the NVIDIA end user license agreement (EULA) associated
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_TraceReturn(Py_None, 0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cuda._lib.ccudart.ccudart", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cuda._lib.ccudart.ccudart");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_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;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
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);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *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) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* Profile */
#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   PyThreadState* tstate,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    PyObject *type, *value, *traceback;
    int retval;
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_d,                  /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
#if PY_VERSION_HEX < 0x030400B1
    } else {
        (*frame)->f_tstate = tstate;
#endif
    }
    __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
    retval = 1;
    __Pyx_EnterTracing(tstate);
    __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
    #if CYTHON_TRACE
    if (tstate->c_tracefunc)
        retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
    if (retval && tstate->c_profilefunc)
    #endif
        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
    __Pyx_LeaveTracing(tstate);
    if (retval) {
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
        return __Pyx_IsTracing(tstate, 0, 0) && retval;
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyCodeObject *py_code = 0;
#if PY_MAJOR_VERSION >= 3
    py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
    if (likely(py_code)) {
        py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
    }
#else
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    py_funcname = PyString_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    py_srcfile = PyString_FromString(srcfile);
    if (unlikely(!py_srcfile)) goto bad;
    py_code = PyCode_New(
        0,
        0,
        0,
        CO_OPTIMIZED | CO_NEWLOCALS,
        __pyx_empty_bytes,     /*PyObject *code,*/
        __pyx_empty_tuple,     /*PyObject *consts,*/
        __pyx_empty_tuple,     /*PyObject *names,*/
        __pyx_empty_tuple,     /*PyObject *varnames,*/
        __pyx_empty_tuple,     /*PyObject *freevars,*/
        __pyx_empty_tuple,     /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,
        __pyx_empty_bytes      /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
#endif
    return py_code;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* GetVTable */
static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
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) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    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);
}
#endif

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* 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 PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_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(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
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 PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        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;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    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_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);
}

/* None */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  #ifdef WITH_THREAD
  PyGILState_STATE _save = PyGILState_Ensure();
  #endif
  err = !!PyErr_Occurred();
  #ifdef WITH_THREAD
  PyGILState_Release(_save);
  #endif
  return err;
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                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;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                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;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                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;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                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;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        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;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        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);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
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);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        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));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[5];
    int same=1, i, found_dot;
    const char* rt_from_call = Py_GetVersion();
    PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    found_dot = 0;
    for (i = 0; i < 4; i++) {
        if (!ctversion[i]) {
            same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
            break;
        }
        if (rt_from_call[i] != ctversion[i]) {
            same = 0;
            break;
        }
    }
    if (!same) {
        char rtversion[5] = {'\0'};
        char message[200];
        for (i=0; i<4; ++i) {
            if (rt_from_call[i] == '.') {
                if (found_dot) break;
                found_dot = 1;
            } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
                break;
            }
            rtversion[i] = rt_from_call[i];
        }
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* FunctionImport */
#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        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_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  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 PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      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;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_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);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
