/* Generated by Cython 0.29.26 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "cuda"
        ],
        "extra_compile_args": [
            "-std=c++14",
            "-fpermissive",
            "-Wno-deprecated-declarations",
            "-D _GLIBCXX_ASSERTIONS",
            "-fno-var-tracking-assignments",
            "-O3"
        ],
        "include_dirs": [
            "./cuda",
            "/home/conda/feedstock_root/build_artifacts/cuda-python_1641445722738/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/include"
        ],
        "language": "c++",
        "library_dirs": [
            "/home/conda/feedstock_root/build_artifacts/cuda-python_1641445722738/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.10/site-packages",
            "/home/conda/feedstock_root/build_artifacts/cuda-python_1641445722738/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/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_26"
#define CYTHON_HEX_VERSION 0x001D1AF0
#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
  #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
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 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
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #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 1
  #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
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1)
  #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)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #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 defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #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 defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #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
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #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(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#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 <string.h>
#include <stdlib.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#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":11
 * 
 * 
 * ctypedef uint32_t cuuint32_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint64_t cuuint64_t
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_cuuint32_t;

/* "cuda/ccuda.pxd":13
 * ctypedef uint32_t cuuint32_t
 * 
 * ctypedef uint64_t cuuint64_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long CUdeviceptr_v2
 */
typedef uint64_t __pyx_t_4cuda_5ccuda_cuuint64_t;

/* "cuda/ccuda.pxd":15
 * ctypedef uint64_t cuuint64_t
 * 
 * ctypedef unsigned long long CUdeviceptr_v2             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUdeviceptr_v2 CUdeviceptr
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_5ccuda_CUdeviceptr_v2;

/* "cuda/ccuda.pxd":17
 * ctypedef unsigned long long CUdeviceptr_v2
 * 
 * ctypedef CUdeviceptr_v2 CUdeviceptr             # <<<<<<<<<<<<<<
 * 
 * ctypedef int CUdevice_v1
 */
typedef __pyx_t_4cuda_5ccuda_CUdeviceptr_v2 __pyx_t_4cuda_5ccuda_CUdeviceptr;

/* "cuda/ccuda.pxd":19
 * ctypedef CUdeviceptr_v2 CUdeviceptr
 * 
 * ctypedef int CUdevice_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUdevice_v1 CUdevice
 */
typedef int __pyx_t_4cuda_5ccuda_CUdevice_v1;

/* "cuda/ccuda.pxd":21
 * ctypedef int CUdevice_v1
 * 
 * ctypedef CUdevice_v1 CUdevice             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef __pyx_t_4cuda_5ccuda_CUdevice_v1 __pyx_t_4cuda_5ccuda_CUdevice;

/* "cuda/ccuda.pxd":73
 * ctypedef CUgraphicsResource_st* CUgraphicsResource
 * 
 * ctypedef unsigned long long CUtexObject_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUtexObject_v1 CUtexObject
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_5ccuda_CUtexObject_v1;

/* "cuda/ccuda.pxd":75
 * ctypedef unsigned long long CUtexObject_v1
 * 
 * ctypedef CUtexObject_v1 CUtexObject             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long CUsurfObject_v1
 */
typedef __pyx_t_4cuda_5ccuda_CUtexObject_v1 __pyx_t_4cuda_5ccuda_CUtexObject;

/* "cuda/ccuda.pxd":77
 * ctypedef CUtexObject_v1 CUtexObject
 * 
 * ctypedef unsigned long long CUsurfObject_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUsurfObject_v1 CUsurfObject
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_5ccuda_CUsurfObject_v1;

/* "cuda/ccuda.pxd":79
 * ctypedef unsigned long long CUsurfObject_v1
 * 
 * ctypedef CUsurfObject_v1 CUsurfObject             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef __pyx_t_4cuda_5ccuda_CUsurfObject_v1 __pyx_t_4cuda_5ccuda_CUsurfObject;

/* "cuda/ccuda.pxd":1340
 * ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS
 * 
 * ctypedef unsigned long long CUmemGenericAllocationHandle_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_5ccuda_CUmemGenericAllocationHandle_v1;

/* "cuda/ccuda.pxd":1342
 * ctypedef unsigned long long CUmemGenericAllocationHandle_v1
 * 
 * ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAllocationHandleType_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemGenericAllocationHandle_v1 __pyx_t_4cuda_5ccuda_CUmemGenericAllocationHandle;

/* "cuda/ccudart.pxd":1051
 *     cudaFormatModeAuto = 1
 * 
 * ctypedef unsigned long long cudaSurfaceObject_t             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaTextureAddressMode:
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_7ccudart_cudaSurfaceObject_t;

/* "cuda/ccudart.pxd":1081
 *     int disableTrilinearOptimization
 * 
 * ctypedef unsigned long long cudaTextureObject_t             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaDataType_t:
 */
typedef unsigned PY_LONG_LONG __pyx_t_4cuda_7ccudart_cudaTextureObject_t;

/*--- Type declarations ---*/
struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
struct __pyx_t_4cuda_5ccuda_CUuuid_st;
struct __pyx_t_4cuda_5ccuda_CUipcEventHandle_st;
struct __pyx_t_4cuda_5ccuda_CUipcMemHandle_st;
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWaitValueParams_st;
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWriteValueParams_st;
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpFlushRemoteWritesParams_st;
union __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams_union;
struct __pyx_t_4cuda_5ccuda_CUdevprop_st;
struct __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow_st;
struct __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS_st;
struct __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS_st;
struct __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS_st;
union __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue_union;
union __pyx_t_4cuda_5ccuda_CUstreamAttrValue_union;
struct __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount_st;
union __pyx_t_4cuda_5ccuda__CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u;
struct __pyx_t_4cuda_5ccuda_CUexecAffinityParam_st;
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D_st;
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_st;
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER_st;
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR_st;
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_st;
struct __pyx_t_4cuda_5ccuda__CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s;
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES_st;
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s;
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_mipmap_s;
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_linear_s;
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_pitch2D_s;
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_reserved_s;
union __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_u;
struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC_st;
struct __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC_st;
struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC_st;
struct __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st;
struct __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS_st;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s;
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_u;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s;
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_u;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s;
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_nvSciSync_u;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_keyedMutex_s;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_s;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s;
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_nvSciSync_u;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_keyedMutex_s;
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_s;
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st;
struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st;
struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS_st;
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u;
struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_sparseLevel_s;
struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s;
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_u;
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_memHandle_u;
struct __pyx_t_4cuda_5ccuda_CUarrayMapInfo_st;
struct __pyx_t_4cuda_5ccuda_CUmemLocation_st;
struct __pyx_t_4cuda_5ccuda__CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s;
struct __pyx_t_4cuda_5ccuda_CUmemAllocationProp_st;
struct __pyx_t_4cuda_5ccuda_CUmemAccessDesc_st;
struct __pyx_t_4cuda_5ccuda_CUmemPoolProps_st;
struct __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData_st;
struct __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS_st;

/* "cuda/ccuda.pxd":135
 * ctypedef CUipcMemHandle_v1 CUipcMemHandle
 * 
 * cdef enum CUipcMem_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUipcMem_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1
};

/* "cuda/ccuda.pxd":140
 * ctypedef CUipcMem_flags_enum CUipcMem_flags
 * 
 * cdef enum CUmemAttach_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ATTACH_GLOBAL = 0x1
 *     CU_MEM_ATTACH_HOST = 0x2
 */
enum __pyx_t_4cuda_5ccuda_CUmemAttach_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ATTACH_GLOBAL = 0x1,
  __pyx_e_4cuda_5ccuda_CU_MEM_ATTACH_HOST = 0x2,
  __pyx_e_4cuda_5ccuda_CU_MEM_ATTACH_SINGLE = 0x4
};

/* "cuda/ccuda.pxd":147
 * ctypedef CUmemAttach_flags_enum CUmemAttach_flags
 * 
 * cdef enum CUctx_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_CTX_SCHED_AUTO = 0x00
 *     CU_CTX_SCHED_SPIN = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUctx_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_CTX_SCHED_AUTO = 0x00,
  __pyx_e_4cuda_5ccuda_CU_CTX_SCHED_SPIN = 0x01,
  __pyx_e_4cuda_5ccuda_CU_CTX_SCHED_YIELD = 0x02,
  __pyx_e_4cuda_5ccuda_CU_CTX_SCHED_BLOCKING_SYNC = 0x04,
  __pyx_e_4cuda_5ccuda_CU_CTX_BLOCKING_SYNC = 0x04,
  __pyx_e_4cuda_5ccuda_CU_CTX_SCHED_MASK = 0x07,
  __pyx_e_4cuda_5ccuda_CU_CTX_MAP_HOST = 0x08,
  __pyx_e_4cuda_5ccuda_CU_CTX_LMEM_RESIZE_TO_MAX = 0x10,
  __pyx_e_4cuda_5ccuda_CU_CTX_FLAGS_MASK = 0x1f
};

/* "cuda/ccuda.pxd":160
 * ctypedef CUctx_flags_enum CUctx_flags
 * 
 * cdef enum CUstream_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_DEFAULT = 0x0
 *     CU_STREAM_NON_BLOCKING = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUstream_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_NON_BLOCKING = 0x1
};

/* "cuda/ccuda.pxd":166
 * ctypedef CUstream_flags_enum CUstream_flags
 * 
 * cdef enum CUevent_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_EVENT_DEFAULT = 0x0
 *     CU_EVENT_BLOCKING_SYNC = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUevent_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_EVENT_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_EVENT_BLOCKING_SYNC = 0x1,
  __pyx_e_4cuda_5ccuda_CU_EVENT_DISABLE_TIMING = 0x2,
  __pyx_e_4cuda_5ccuda_CU_EVENT_INTERPROCESS = 0x4
};

/* "cuda/ccuda.pxd":174
 * ctypedef CUevent_flags_enum CUevent_flags
 * 
 * cdef enum CUevent_record_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_EVENT_RECORD_DEFAULT = 0x0
 *     CU_EVENT_RECORD_EXTERNAL = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUevent_record_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_EVENT_RECORD_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_EVENT_RECORD_EXTERNAL = 0x1
};

/* "cuda/ccuda.pxd":180
 * ctypedef CUevent_record_flags_enum CUevent_record_flags
 * 
 * cdef enum CUevent_wait_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_EVENT_WAIT_DEFAULT = 0x0
 *     CU_EVENT_WAIT_EXTERNAL = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUevent_wait_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_EVENT_WAIT_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_EVENT_WAIT_EXTERNAL = 0x1
};

/* "cuda/ccuda.pxd":186
 * ctypedef CUevent_wait_flags_enum CUevent_wait_flags
 * 
 * cdef enum CUstreamWaitValue_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_WAIT_VALUE_GEQ = 0x0
 *     CU_STREAM_WAIT_VALUE_EQ = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUstreamWaitValue_flags_enum {

  /* "cuda/ccuda.pxd":191
 *     CU_STREAM_WAIT_VALUE_AND = 0x2
 *     CU_STREAM_WAIT_VALUE_NOR = 0x3
 *     CU_STREAM_WAIT_VALUE_FLUSH = 1<<30             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags
 */
  __pyx_e_4cuda_5ccuda_CU_STREAM_WAIT_VALUE_GEQ = 0x0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_WAIT_VALUE_EQ = 0x1,
  __pyx_e_4cuda_5ccuda_CU_STREAM_WAIT_VALUE_AND = 0x2,
  __pyx_e_4cuda_5ccuda_CU_STREAM_WAIT_VALUE_NOR = 0x3,
  __pyx_e_4cuda_5ccuda_CU_STREAM_WAIT_VALUE_FLUSH = (1 << 30)
};

/* "cuda/ccuda.pxd":195
 * ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags
 * 
 * cdef enum CUstreamWriteValue_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_WRITE_VALUE_DEFAULT = 0x0
 *     CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUstreamWriteValue_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_WRITE_VALUE_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 0x1
};

/* "cuda/ccuda.pxd":201
 * ctypedef CUstreamWriteValue_flags_enum CUstreamWriteValue_flags
 * 
 * cdef enum CUstreamBatchMemOpType_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1
 *     CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2
 */
enum __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
  __pyx_e_4cuda_5ccuda_CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2,
  __pyx_e_4cuda_5ccuda_CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4,
  __pyx_e_4cuda_5ccuda_CU_STREAM_MEM_OP_WRITE_VALUE_64 = 5,
  __pyx_e_4cuda_5ccuda_CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3
};

/* "cuda/ccuda.pxd":239
 * ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams
 * 
 * cdef enum CUoccupancy_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_OCCUPANCY_DEFAULT = 0x0
 *     CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUoccupancy_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_OCCUPANCY_DEFAULT = 0x0,
  __pyx_e_4cuda_5ccuda_CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1
};

/* "cuda/ccuda.pxd":245
 * ctypedef CUoccupancy_flags_enum CUoccupancy_flags
 * 
 * cdef enum CUstreamUpdateCaptureDependencies_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_ADD_CAPTURE_DEPENDENCIES = 0x0
 *     CU_STREAM_SET_CAPTURE_DEPENDENCIES = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUstreamUpdateCaptureDependencies_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ADD_CAPTURE_DEPENDENCIES = 0x0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_SET_CAPTURE_DEPENDENCIES = 0x1
};

/* "cuda/ccuda.pxd":251
 * ctypedef CUstreamUpdateCaptureDependencies_flags_enum CUstreamUpdateCaptureDependencies_flags
 * 
 * cdef enum CUarray_format_enum:             # <<<<<<<<<<<<<<
 *     CU_AD_FORMAT_UNSIGNED_INT8 = 0x01
 *     CU_AD_FORMAT_UNSIGNED_INT16 = 0x02
 */
enum __pyx_t_4cuda_5ccuda_CUarray_format_enum {
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT8 = 0x08,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT16 = 0x09,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_HALF = 0x10,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_FLOAT = 0x20,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_NV12 = 0xb0,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC1_UNORM = 0x91,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC2_UNORM = 0x93,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC3_UNORM = 0x95,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC4_UNORM = 0x97,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC4_SNORM = 0x98,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC5_UNORM = 0x99,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC5_SNORM = 0x9a,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC6H_UF16 = 0x9b,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC6H_SF16 = 0x9c,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC7_UNORM = 0x9d,
  __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e
};

/* "cuda/ccuda.pxd":290
 * ctypedef CUarray_format_enum CUarray_format
 * 
 * cdef enum CUaddress_mode_enum:             # <<<<<<<<<<<<<<
 *     CU_TR_ADDRESS_MODE_WRAP = 0
 *     CU_TR_ADDRESS_MODE_CLAMP = 1
 */
enum __pyx_t_4cuda_5ccuda_CUaddress_mode_enum {
  __pyx_e_4cuda_5ccuda_CU_TR_ADDRESS_MODE_WRAP = 0,
  __pyx_e_4cuda_5ccuda_CU_TR_ADDRESS_MODE_CLAMP = 1,
  __pyx_e_4cuda_5ccuda_CU_TR_ADDRESS_MODE_MIRROR = 2,
  __pyx_e_4cuda_5ccuda_CU_TR_ADDRESS_MODE_BORDER = 3
};

/* "cuda/ccuda.pxd":298
 * ctypedef CUaddress_mode_enum CUaddress_mode
 * 
 * cdef enum CUfilter_mode_enum:             # <<<<<<<<<<<<<<
 *     CU_TR_FILTER_MODE_POINT = 0
 *     CU_TR_FILTER_MODE_LINEAR = 1
 */
enum __pyx_t_4cuda_5ccuda_CUfilter_mode_enum {
  __pyx_e_4cuda_5ccuda_CU_TR_FILTER_MODE_POINT = 0,
  __pyx_e_4cuda_5ccuda_CU_TR_FILTER_MODE_LINEAR = 1
};

/* "cuda/ccuda.pxd":304
 * ctypedef CUfilter_mode_enum CUfilter_mode
 * 
 * cdef enum CUdevice_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1
 *     CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2
 */
enum __pyx_t_4cuda_5ccuda_CUdevice_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_INTEGRATED = 18,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS = 92,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 93,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 94,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 0x64,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 0x65,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 0x66,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 0x66,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 0x67,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 0x68,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 0x69,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 0x6A,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 0x6B,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 0x6C,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 0x6D,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 0x6E,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 0x6F,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 0x70,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 0x71,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 0x72,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 0x73,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = 0x74,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = 0x75,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = 0x76,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = 0x77,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MAX
};

/* "cuda/ccuda.pxd":450
 * ctypedef CUdevprop_v1 CUdevprop
 * 
 * cdef enum CUpointer_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_POINTER_ATTRIBUTE_CONTEXT = 1
 *     CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2
 */
enum __pyx_t_4cuda_5ccuda_CUpointer_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_CONTEXT = 1,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_HOST_POINTER = 4,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = 10,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = 11,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_MAPPED = 13,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17
};

/* "cuda/ccuda.pxd":471
 * ctypedef CUpointer_attribute_enum CUpointer_attribute
 * 
 * cdef enum CUfunction_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0
 *     CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1
 */
enum __pyx_t_4cuda_5ccuda_CUfunction_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
  __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_MAX
};

/* "cuda/ccuda.pxd":486
 * ctypedef CUfunction_attribute_enum CUfunction_attribute
 * 
 * cdef enum CUfunc_cache_enum:             # <<<<<<<<<<<<<<
 *     CU_FUNC_CACHE_PREFER_NONE = 0x00
 *     CU_FUNC_CACHE_PREFER_SHARED = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUfunc_cache_enum {
  __pyx_e_4cuda_5ccuda_CU_FUNC_CACHE_PREFER_NONE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_FUNC_CACHE_PREFER_SHARED = 0x01,
  __pyx_e_4cuda_5ccuda_CU_FUNC_CACHE_PREFER_L1 = 0x02,
  __pyx_e_4cuda_5ccuda_CU_FUNC_CACHE_PREFER_EQUAL = 0x03
};

/* "cuda/ccuda.pxd":494
 * ctypedef CUfunc_cache_enum CUfunc_cache
 * 
 * cdef enum CUsharedconfig_enum:             # <<<<<<<<<<<<<<
 *     CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00
 *     CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUsharedconfig_enum {
  __pyx_e_4cuda_5ccuda_CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01,
  __pyx_e_4cuda_5ccuda_CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02
};

/* "cuda/ccuda.pxd":501
 * ctypedef CUsharedconfig_enum CUsharedconfig
 * 
 * cdef enum CUshared_carveout_enum:             # <<<<<<<<<<<<<<
 *     CU_SHAREDMEM_CARVEOUT_DEFAULT = -1
 *     CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100
 */
enum __pyx_t_4cuda_5ccuda_CUshared_carveout_enum {
  __pyx_e_4cuda_5ccuda_CU_SHAREDMEM_CARVEOUT_DEFAULT = -1L,
  __pyx_e_4cuda_5ccuda_CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 0x64,
  __pyx_e_4cuda_5ccuda_CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0
};

/* "cuda/ccuda.pxd":508
 * ctypedef CUshared_carveout_enum CUshared_carveout
 * 
 * cdef enum CUmemorytype_enum:             # <<<<<<<<<<<<<<
 *     CU_MEMORYTYPE_HOST = 0x01
 *     CU_MEMORYTYPE_DEVICE = 0x02
 */
enum __pyx_t_4cuda_5ccuda_CUmemorytype_enum {
  __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_HOST = 0x01,
  __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_DEVICE = 0x02,
  __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_ARRAY = 0x03,
  __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_UNIFIED = 0x04
};

/* "cuda/ccuda.pxd":516
 * ctypedef CUmemorytype_enum CUmemorytype
 * 
 * cdef enum CUcomputemode_enum:             # <<<<<<<<<<<<<<
 *     CU_COMPUTEMODE_DEFAULT = 0
 *     CU_COMPUTEMODE_PROHIBITED = 2
 */
enum __pyx_t_4cuda_5ccuda_CUcomputemode_enum {
  __pyx_e_4cuda_5ccuda_CU_COMPUTEMODE_DEFAULT = 0,
  __pyx_e_4cuda_5ccuda_CU_COMPUTEMODE_PROHIBITED = 2,
  __pyx_e_4cuda_5ccuda_CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3
};

/* "cuda/ccuda.pxd":523
 * ctypedef CUcomputemode_enum CUcomputemode
 * 
 * cdef enum CUmem_advise_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ADVISE_SET_READ_MOSTLY = 1
 *     CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2
 */
enum __pyx_t_4cuda_5ccuda_CUmem_advise_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_SET_READ_MOSTLY = 1,
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2,
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3,
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4,
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_SET_ACCESSED_BY = 5,
  __pyx_e_4cuda_5ccuda_CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6
};

/* "cuda/ccuda.pxd":533
 * ctypedef CUmem_advise_enum CUmem_advise
 * 
 * cdef enum CUmem_range_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1
 *     CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2
 */
enum __pyx_t_4cuda_5ccuda_CUmem_range_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1,
  __pyx_e_4cuda_5ccuda_CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2,
  __pyx_e_4cuda_5ccuda_CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3,
  __pyx_e_4cuda_5ccuda_CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4
};

/* "cuda/ccuda.pxd":541
 * ctypedef CUmem_range_attribute_enum CUmem_range_attribute
 * 
 * cdef enum CUjit_option_enum:             # <<<<<<<<<<<<<<
 *     CU_JIT_MAX_REGISTERS = 0
 *     CU_JIT_THREADS_PER_BLOCK
 */
enum __pyx_t_4cuda_5ccuda_CUjit_option_enum {
  __pyx_e_4cuda_5ccuda_CU_JIT_MAX_REGISTERS = 0,
  __pyx_e_4cuda_5ccuda_CU_JIT_THREADS_PER_BLOCK,
  __pyx_e_4cuda_5ccuda_CU_JIT_WALL_TIME,
  __pyx_e_4cuda_5ccuda_CU_JIT_INFO_LOG_BUFFER,
  __pyx_e_4cuda_5ccuda_CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES,
  __pyx_e_4cuda_5ccuda_CU_JIT_ERROR_LOG_BUFFER,
  __pyx_e_4cuda_5ccuda_CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES,
  __pyx_e_4cuda_5ccuda_CU_JIT_OPTIMIZATION_LEVEL,
  __pyx_e_4cuda_5ccuda_CU_JIT_TARGET_FROM_CUCONTEXT,
  __pyx_e_4cuda_5ccuda_CU_JIT_TARGET,
  __pyx_e_4cuda_5ccuda_CU_JIT_FALLBACK_STRATEGY,
  __pyx_e_4cuda_5ccuda_CU_JIT_GENERATE_DEBUG_INFO,
  __pyx_e_4cuda_5ccuda_CU_JIT_LOG_VERBOSE,
  __pyx_e_4cuda_5ccuda_CU_JIT_GENERATE_LINE_INFO,
  __pyx_e_4cuda_5ccuda_CU_JIT_CACHE_MODE,
  __pyx_e_4cuda_5ccuda_CU_JIT_NEW_SM3X_OPT,
  __pyx_e_4cuda_5ccuda_CU_JIT_FAST_COMPILE,
  __pyx_e_4cuda_5ccuda_CU_JIT_GLOBAL_SYMBOL_NAMES,
  __pyx_e_4cuda_5ccuda_CU_JIT_GLOBAL_SYMBOL_ADDRESSES,
  __pyx_e_4cuda_5ccuda_CU_JIT_GLOBAL_SYMBOL_COUNT,
  __pyx_e_4cuda_5ccuda_CU_JIT_LTO,
  __pyx_e_4cuda_5ccuda_CU_JIT_FTZ,
  __pyx_e_4cuda_5ccuda_CU_JIT_PREC_DIV,
  __pyx_e_4cuda_5ccuda_CU_JIT_PREC_SQRT,
  __pyx_e_4cuda_5ccuda_CU_JIT_FMA,
  __pyx_e_4cuda_5ccuda_CU_JIT_NUM_OPTIONS
};

/* "cuda/ccuda.pxd":571
 * ctypedef CUjit_option_enum CUjit_option
 * 
 * cdef enum CUjit_target_enum:             # <<<<<<<<<<<<<<
 *     CU_TARGET_COMPUTE_20 = 20
 *     CU_TARGET_COMPUTE_21 = 21
 */
enum __pyx_t_4cuda_5ccuda_CUjit_target_enum {
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_20 = 20,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_21 = 21,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_30 = 30,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_32 = 32,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_35 = 35,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_37 = 37,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_50 = 50,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_52 = 52,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_53 = 53,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_60 = 60,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_61 = 61,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_62 = 62,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_70 = 70,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_72 = 72,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_75 = 75,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_80 = 80,
  __pyx_e_4cuda_5ccuda_CU_TARGET_COMPUTE_86 = 86
};

/* "cuda/ccuda.pxd":592
 * ctypedef CUjit_target_enum CUjit_target
 * 
 * cdef enum CUjit_fallback_enum:             # <<<<<<<<<<<<<<
 *     CU_PREFER_PTX = 0
 *     CU_PREFER_BINARY
 */
enum __pyx_t_4cuda_5ccuda_CUjit_fallback_enum {
  __pyx_e_4cuda_5ccuda_CU_PREFER_PTX = 0,
  __pyx_e_4cuda_5ccuda_CU_PREFER_BINARY
};

/* "cuda/ccuda.pxd":598
 * ctypedef CUjit_fallback_enum CUjit_fallback
 * 
 * cdef enum CUjit_cacheMode_enum:             # <<<<<<<<<<<<<<
 *     CU_JIT_CACHE_OPTION_NONE = 0
 *     CU_JIT_CACHE_OPTION_CG
 */
enum __pyx_t_4cuda_5ccuda_CUjit_cacheMode_enum {
  __pyx_e_4cuda_5ccuda_CU_JIT_CACHE_OPTION_NONE = 0,
  __pyx_e_4cuda_5ccuda_CU_JIT_CACHE_OPTION_CG,
  __pyx_e_4cuda_5ccuda_CU_JIT_CACHE_OPTION_CA
};

/* "cuda/ccuda.pxd":605
 * ctypedef CUjit_cacheMode_enum CUjit_cacheMode
 * 
 * cdef enum CUjitInputType_enum:             # <<<<<<<<<<<<<<
 *     CU_JIT_INPUT_CUBIN = 0
 *     CU_JIT_INPUT_PTX
 */
enum __pyx_t_4cuda_5ccuda_CUjitInputType_enum {
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_CUBIN = 0,
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_PTX,
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_FATBINARY,
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_OBJECT,
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_LIBRARY,
  __pyx_e_4cuda_5ccuda_CU_JIT_INPUT_NVVM,
  __pyx_e_4cuda_5ccuda_CU_JIT_NUM_INPUT_TYPES
};

/* "cuda/ccuda.pxd":621
 * ctypedef CUlinkState_st* CUlinkState
 * 
 * cdef enum CUgraphicsRegisterFlags_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPHICS_REGISTER_FLAGS_NONE = 0x00
 *     CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUgraphicsRegisterFlags_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_REGISTER_FLAGS_NONE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 0x01,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 0x02,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 0x04,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08
};

/* "cuda/ccuda.pxd":630
 * ctypedef CUgraphicsRegisterFlags_enum CUgraphicsRegisterFlags
 * 
 * cdef enum CUgraphicsMapResourceFlags_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00
 *     CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUgraphicsMapResourceFlags_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
  __pyx_e_4cuda_5ccuda_CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02
};

/* "cuda/ccuda.pxd":637
 * ctypedef CUgraphicsMapResourceFlags_enum CUgraphicsMapResourceFlags
 * 
 * cdef enum CUarray_cubemap_face_enum:             # <<<<<<<<<<<<<<
 *     CU_CUBEMAP_FACE_POSITIVE_X = 0x00
 *     CU_CUBEMAP_FACE_NEGATIVE_X = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUarray_cubemap_face_enum {
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_POSITIVE_X = 0x00,
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_NEGATIVE_X = 0x01,
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_POSITIVE_Y = 0x02,
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_NEGATIVE_Y = 0x03,
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_POSITIVE_Z = 0x04,
  __pyx_e_4cuda_5ccuda_CU_CUBEMAP_FACE_NEGATIVE_Z = 0x05
};

/* "cuda/ccuda.pxd":647
 * ctypedef CUarray_cubemap_face_enum CUarray_cubemap_face
 * 
 * cdef enum CUlimit_enum:             # <<<<<<<<<<<<<<
 *     CU_LIMIT_STACK_SIZE = 0x00
 *     CU_LIMIT_PRINTF_FIFO_SIZE = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUlimit_enum {
  __pyx_e_4cuda_5ccuda_CU_LIMIT_STACK_SIZE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_PRINTF_FIFO_SIZE = 0x01,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_MALLOC_HEAP_SIZE = 0x02,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x03,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 0x04,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 0x05,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 0x06,
  __pyx_e_4cuda_5ccuda_CU_LIMIT_MAX
};

/* "cuda/ccuda.pxd":659
 * ctypedef CUlimit_enum CUlimit
 * 
 * cdef enum CUresourcetype_enum:             # <<<<<<<<<<<<<<
 *     CU_RESOURCE_TYPE_ARRAY = 0x00
 *     CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUresourcetype_enum {
  __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_ARRAY = 0x00,
  __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
  __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_LINEAR = 0x02,
  __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_PITCH2D = 0x03
};

/* "cuda/ccuda.pxd":669
 * ctypedef void (*CUhostFn)(void* userData)
 * 
 * cdef enum CUaccessProperty_enum:             # <<<<<<<<<<<<<<
 *     CU_ACCESS_PROPERTY_NORMAL = 0
 *     CU_ACCESS_PROPERTY_STREAMING = 1
 */
enum __pyx_t_4cuda_5ccuda_CUaccessProperty_enum {
  __pyx_e_4cuda_5ccuda_CU_ACCESS_PROPERTY_NORMAL = 0,
  __pyx_e_4cuda_5ccuda_CU_ACCESS_PROPERTY_STREAMING = 1,
  __pyx_e_4cuda_5ccuda_CU_ACCESS_PROPERTY_PERSISTING = 2
};

/* "cuda/ccuda.pxd":723
 * ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS
 * 
 * cdef enum CUgraphNodeType_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPH_NODE_TYPE_KERNEL = 0
 *     CU_GRAPH_NODE_TYPE_MEMCPY = 1
 */
enum __pyx_t_4cuda_5ccuda_CUgraphNodeType_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_KERNEL = 0,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_MEMCPY = 1,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_MEMSET = 2,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_HOST = 3,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_GRAPH = 4,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_EMPTY = 5,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_WAIT_EVENT = 6,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_EVENT_RECORD = 7,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = 8,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = 9,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_MEM_ALLOC = 10,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_NODE_TYPE_MEM_FREE = 11
};

/* "cuda/ccuda.pxd":739
 * ctypedef CUgraphNodeType_enum CUgraphNodeType
 * 
 * cdef enum CUsynchronizationPolicy_enum:             # <<<<<<<<<<<<<<
 *     CU_SYNC_POLICY_AUTO = 1
 *     CU_SYNC_POLICY_SPIN = 2
 */
enum __pyx_t_4cuda_5ccuda_CUsynchronizationPolicy_enum {
  __pyx_e_4cuda_5ccuda_CU_SYNC_POLICY_AUTO = 1,
  __pyx_e_4cuda_5ccuda_CU_SYNC_POLICY_SPIN = 2,
  __pyx_e_4cuda_5ccuda_CU_SYNC_POLICY_YIELD = 3,
  __pyx_e_4cuda_5ccuda_CU_SYNC_POLICY_BLOCKING_SYNC = 4
};

/* "cuda/ccuda.pxd":747
 * ctypedef CUsynchronizationPolicy_enum CUsynchronizationPolicy
 * 
 * cdef enum CUkernelNodeAttrID_enum:             # <<<<<<<<<<<<<<
 *     CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 *     CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
 */
enum __pyx_t_4cuda_5ccuda_CUkernelNodeAttrID_enum {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1,
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
};

/* "cuda/ccuda.pxd":761
 * ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue
 * 
 * cdef enum CUstreamCaptureStatus_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_CAPTURE_STATUS_NONE = 0
 *     CU_STREAM_CAPTURE_STATUS_ACTIVE = 1
 */
enum __pyx_t_4cuda_5ccuda_CUstreamCaptureStatus_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_STATUS_NONE = 0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_STATUS_ACTIVE = 1,
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2
};

/* "cuda/ccuda.pxd":768
 * ctypedef CUstreamCaptureStatus_enum CUstreamCaptureStatus
 * 
 * cdef enum CUstreamCaptureMode_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_CAPTURE_MODE_GLOBAL = 0
 *     CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1
 */
enum __pyx_t_4cuda_5ccuda_CUstreamCaptureMode_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_MODE_GLOBAL = 0,
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1,
  __pyx_e_4cuda_5ccuda_CU_STREAM_CAPTURE_MODE_RELAXED = 2
};

/* "cuda/ccuda.pxd":775
 * ctypedef CUstreamCaptureMode_enum CUstreamCaptureMode
 * 
 * cdef enum CUstreamAttrID_enum:             # <<<<<<<<<<<<<<
 *     CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 *     CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 */
enum __pyx_t_4cuda_5ccuda_CUstreamAttrID_enum {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1,
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
};

/* "cuda/ccuda.pxd":789
 * ctypedef CUstreamAttrValue_v1 CUstreamAttrValue
 * 
 * cdef enum CUdriverProcAddress_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_GET_PROC_ADDRESS_DEFAULT = 0
 *     CU_GET_PROC_ADDRESS_LEGACY_STREAM = 1 << 0
 */
enum __pyx_t_4cuda_5ccuda_CUdriverProcAddress_flags_enum {

  /* "cuda/ccuda.pxd":792
 *     CU_GET_PROC_ADDRESS_DEFAULT = 0
 *     CU_GET_PROC_ADDRESS_LEGACY_STREAM = 1 << 0
 *     CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = 1 << 1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags
 */
  __pyx_e_4cuda_5ccuda_CU_GET_PROC_ADDRESS_DEFAULT = 0,
  __pyx_e_4cuda_5ccuda_CU_GET_PROC_ADDRESS_LEGACY_STREAM = (1 << 0),
  __pyx_e_4cuda_5ccuda_CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = (1 << 1)
};

/* "cuda/ccuda.pxd":796
 * ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags
 * 
 * cdef enum CUexecAffinityType_enum:             # <<<<<<<<<<<<<<
 *     CU_EXEC_AFFINITY_TYPE_SM_COUNT = 0
 *     CU_EXEC_AFFINITY_TYPE_MAX
 */
enum __pyx_t_4cuda_5ccuda_CUexecAffinityType_enum {
  __pyx_e_4cuda_5ccuda_CU_EXEC_AFFINITY_TYPE_SM_COUNT = 0,
  __pyx_e_4cuda_5ccuda_CU_EXEC_AFFINITY_TYPE_MAX
};

/* "cuda/ccuda.pxd":820
 * ctypedef CUexecAffinityParam_v1 CUexecAffinityParam
 * 
 * cdef enum cudaError_enum:             # <<<<<<<<<<<<<<
 *     CUDA_SUCCESS = 0
 *     CUDA_ERROR_INVALID_VALUE = 1
 */
enum __pyx_t_4cuda_5ccuda_cudaError_enum {
  __pyx_e_4cuda_5ccuda_CUDA_SUCCESS = 0,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_VALUE = 1,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_OUT_OF_MEMORY = 2,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_INITIALIZED = 3,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_DEINITIALIZED = 4,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PROFILER_DISABLED = 5,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PROFILER_ALREADY_STARTED = 7,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STUB_LIBRARY = 34,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NO_DEVICE = 0x64,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_DEVICE = 0x65,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_DEVICE_NOT_LICENSED = 0x66,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_IMAGE = 0xC8,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_CONTEXT = 0xC9,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 0xCA,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MAP_FAILED = 0xCD,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_UNMAP_FAILED = 0xCE,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ARRAY_IS_MAPPED = 0xCF,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ALREADY_MAPPED = 0xD0,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NO_BINARY_FOR_GPU = 0xD1,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ALREADY_ACQUIRED = 0xD2,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_MAPPED = 0xD3,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 0xD4,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_MAPPED_AS_POINTER = 0xD5,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ECC_UNCORRECTABLE = 0xD6,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_UNSUPPORTED_LIMIT = 0xD7,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 0xD8,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 0xD9,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_PTX = 0xDA,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 0xDB,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NVLINK_UNCORRECTABLE = 0xDC,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 0xDD,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 0xDE,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_JIT_COMPILATION_DISABLED = 0xDF,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = 0xE0,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_SOURCE = 0x12C,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_FILE_NOT_FOUND = 0x12D,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 0x12E,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 0x12F,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_OPERATING_SYSTEM = 0x130,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_HANDLE = 0x190,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ILLEGAL_STATE = 0x191,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND = 0x1F4,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_READY = 0x258,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ILLEGAL_ADDRESS = 0x2BC,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 0x2BD,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_LAUNCH_TIMEOUT = 0x2BE,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 0x2BF,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 0x2C0,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 0x2C1,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 0x2C4,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_CONTEXT_IS_DESTROYED = 0x2C5,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ASSERT = 0x2C6,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_TOO_MANY_PEERS = 0x2C7,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 0x2C8,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 0x2C9,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_HARDWARE_STACK_ERROR = 0x2CA,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_ILLEGAL_INSTRUCTION = 0x2CB,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MISALIGNED_ADDRESS = 0x2CC,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_ADDRESS_SPACE = 0x2CD,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_PC = 0x2CE,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_LAUNCH_FAILED = 0x2CF,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 0x2D0,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_PERMITTED = 0x320,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_SUPPORTED = 0x321,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_SYSTEM_NOT_READY = 0x322,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 0x323,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 0x324,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MPS_CONNECTION_FAILED = 0x325,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MPS_RPC_FAILURE = 0x326,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MPS_SERVER_NOT_READY = 0x327,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = 0x328,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = 0x329,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 0x384,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 0x385,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_MERGE = 0x386,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 0x387,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 0x388,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 0x389,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 0x38A,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_CAPTURED_EVENT = 0x38B,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 0x38C,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_TIMEOUT = 0x38D,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 0x38E,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_EXTERNAL_DEVICE = 0x38F,
  __pyx_e_4cuda_5ccuda_CUDA_ERROR_UNKNOWN = 0x3E7
};

/* "cuda/ccuda.pxd":911
 * ctypedef cudaError_enum CUresult
 * 
 * cdef enum CUdevice_P2PAttribute_enum:             # <<<<<<<<<<<<<<
 *     CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01
 *     CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02
 */
enum __pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute_enum {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = 0x04,
  __pyx_e_4cuda_5ccuda_CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 0x04
};

/* "cuda/ccuda.pxd":1101
 * ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC
 * 
 * cdef enum CUresourceViewFormat_enum:             # <<<<<<<<<<<<<<
 *     CU_RES_VIEW_FORMAT_NONE = 0x00
 *     CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01
 */
enum __pyx_t_4cuda_5ccuda_CUresourceViewFormat_enum {
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_NONE = 0x00,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_2X8 = 0x02,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_4X8 = 0x03,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_1X8 = 0x04,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_2X8 = 0x05,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_4X8 = 0x06,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_1X16 = 0x07,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_2X16 = 0x08,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_4X16 = 0x09,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_1X16 = 0x0a,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_2X16 = 0x0b,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_4X16 = 0x0c,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_1X32 = 0x0d,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_2X32 = 0x0e,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UINT_4X32 = 0x0f,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_1X32 = 0x10,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_2X32 = 0x11,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SINT_4X32 = 0x12,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21,
  __pyx_e_4cuda_5ccuda_CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22
};

/* "cuda/ccuda.pxd":1163
 * ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS
 * 
 * cdef enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum:             # <<<<<<<<<<<<<<
 *     CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0x0
 *     CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum {
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0x0,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 0x1,
  __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 0x3
};

/* "cuda/ccuda.pxd":1186
 * ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS
 * 
 * cdef enum CUexternalMemoryHandleType_enum:             # <<<<<<<<<<<<<<
 *     CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1
 *     CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2
 */
enum __pyx_t_4cuda_5ccuda_CUexternalMemoryHandleType_enum {
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8
};

/* "cuda/ccuda.pxd":1238
 * ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC
 * 
 * cdef enum CUexternalSemaphoreHandleType_enum:             # <<<<<<<<<<<<<<
 *     CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1
 *     CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2
 */
enum __pyx_t_4cuda_5ccuda_CUexternalSemaphoreHandleType_enum {
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9,
  __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10
};

/* "cuda/ccuda.pxd":1344
 * ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle
 * 
 * cdef enum CUmemAllocationHandleType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_HANDLE_TYPE_NONE = 0x0
 *     CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemAllocationHandleType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_NONE = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 0x1,
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_WIN32 = 0x2,
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_WIN32_KMT = 0x4,
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_MAX = 0x7FFFFFFF
};

/* "cuda/ccuda.pxd":1353
 * ctypedef CUmemAllocationHandleType_enum CUmemAllocationHandleType
 * 
 * cdef enum CUmemAccess_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ACCESS_FLAGS_PROT_NONE = 0x0
 *     CU_MEM_ACCESS_FLAGS_PROT_READ = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemAccess_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ACCESS_FLAGS_PROT_NONE = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_ACCESS_FLAGS_PROT_READ = 0x1,
  __pyx_e_4cuda_5ccuda_CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 0x3,
  __pyx_e_4cuda_5ccuda_CU_MEM_ACCESS_FLAGS_PROT_MAX = 0x7FFFFFFF
};

/* "cuda/ccuda.pxd":1361
 * ctypedef CUmemAccess_flags_enum CUmemAccess_flags
 * 
 * cdef enum CUmemLocationType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_LOCATION_TYPE_INVALID = 0x0
 *     CU_MEM_LOCATION_TYPE_DEVICE = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemLocationType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_LOCATION_TYPE_INVALID = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_LOCATION_TYPE_DEVICE = 0x1,
  __pyx_e_4cuda_5ccuda_CU_MEM_LOCATION_TYPE_MAX = 0x7FFFFFFF
};

/* "cuda/ccuda.pxd":1368
 * ctypedef CUmemLocationType_enum CUmemLocationType
 * 
 * cdef enum CUmemAllocationType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ALLOCATION_TYPE_INVALID = 0x0
 *     CU_MEM_ALLOCATION_TYPE_PINNED = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemAllocationType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOCATION_TYPE_INVALID = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOCATION_TYPE_PINNED = 0x1,
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOCATION_TYPE_MAX = 0x7FFFFFFF
};

/* "cuda/ccuda.pxd":1375
 * ctypedef CUmemAllocationType_enum CUmemAllocationType
 * 
 * cdef enum CUmemAllocationGranularity_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0x0
 *     CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemAllocationGranularity_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 0x1
};

/* "cuda/ccuda.pxd":1381
 * ctypedef CUmemAllocationGranularity_flags_enum CUmemAllocationGranularity_flags
 * 
 * cdef enum CUarraySparseSubresourceType_enum:             # <<<<<<<<<<<<<<
 *     CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0
 *     CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1
 */
enum __pyx_t_4cuda_5ccuda_CUarraySparseSubresourceType_enum {
  __pyx_e_4cuda_5ccuda_CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0,
  __pyx_e_4cuda_5ccuda_CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1
};

/* "cuda/ccuda.pxd":1387
 * ctypedef CUarraySparseSubresourceType_enum CUarraySparseSubresourceType
 * 
 * cdef enum CUmemOperationType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_OPERATION_TYPE_MAP = 1
 *     CU_MEM_OPERATION_TYPE_UNMAP = 2
 */
enum __pyx_t_4cuda_5ccuda_CUmemOperationType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_OPERATION_TYPE_MAP = 1,
  __pyx_e_4cuda_5ccuda_CU_MEM_OPERATION_TYPE_UNMAP = 2
};

/* "cuda/ccuda.pxd":1393
 * ctypedef CUmemOperationType_enum CUmemOperationType
 * 
 * cdef enum CUmemHandleType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_HANDLE_TYPE_GENERIC = 0
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUmemHandleType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_HANDLE_TYPE_GENERIC = 0
};

/* "cuda/ccuda.pxd":1449
 * ctypedef CUmemLocation_v1 CUmemLocation
 * 
 * cdef enum CUmemAllocationCompType_enum:             # <<<<<<<<<<<<<<
 *     CU_MEM_ALLOCATION_COMP_NONE = 0x0
 *     CU_MEM_ALLOCATION_COMP_GENERIC = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUmemAllocationCompType_enum {
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOCATION_COMP_NONE = 0x0,
  __pyx_e_4cuda_5ccuda_CU_MEM_ALLOCATION_COMP_GENERIC = 0x1
};

/* "cuda/ccuda.pxd":1480
 * ctypedef CUmemAccessDesc_v1 CUmemAccessDesc
 * 
 * cdef enum CUgraphExecUpdateResult_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPH_EXEC_UPDATE_SUCCESS = 0x0
 *     CU_GRAPH_EXEC_UPDATE_ERROR = 0x1
 */
enum __pyx_t_4cuda_5ccuda_CUgraphExecUpdateResult_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_SUCCESS = 0x0,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR = 0x1,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 0x2,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 0x3,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 0x4,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 0x5,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 0x6,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 0x7
};

/* "cuda/ccuda.pxd":1492
 * ctypedef CUgraphExecUpdateResult_enum CUgraphExecUpdateResult
 * 
 * cdef enum CUmemPool_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1
 *     CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC
 */
enum __pyx_t_4cuda_5ccuda_CUmemPool_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_RELEASE_THRESHOLD,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_USED_MEM_CURRENT,
  __pyx_e_4cuda_5ccuda_CU_MEMPOOL_ATTR_USED_MEM_HIGH
};

/* "cuda/ccuda.pxd":1531
 * ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_st CUDA_MEM_ALLOC_NODE_PARAMS
 * 
 * cdef enum CUgraphMem_attribute_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT
 *     CU_GRAPH_MEM_ATTR_USED_MEM_HIGH
 */
enum __pyx_t_4cuda_5ccuda_CUgraphMem_attribute_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_MEM_ATTR_USED_MEM_HIGH,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT,
  __pyx_e_4cuda_5ccuda_CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH
};

/* "cuda/ccuda.pxd":1539
 * ctypedef CUgraphMem_attribute_enum CUgraphMem_attribute
 * 
 * cdef enum CUflushGPUDirectRDMAWritesOptions_enum:             # <<<<<<<<<<<<<<
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = 1<<0
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 1<<1
 */
enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesOptions_enum {

  /* "cuda/ccuda.pxd":1541
 * cdef enum CUflushGPUDirectRDMAWritesOptions_enum:
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = 1<<0
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 1<<1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions
 */
  __pyx_e_4cuda_5ccuda_CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = (1 << 0),
  __pyx_e_4cuda_5ccuda_CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = (1 << 1)
};

/* "cuda/ccuda.pxd":1545
 * ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions
 * 
 * cdef enum CUGPUDirectRDMAWritesOrdering_enum:             # <<<<<<<<<<<<<<
 *     CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = 0
 *     CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = 100
 */
enum __pyx_t_4cuda_5ccuda_CUGPUDirectRDMAWritesOrdering_enum {
  __pyx_e_4cuda_5ccuda_CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = 0,
  __pyx_e_4cuda_5ccuda_CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = 0x64,
  __pyx_e_4cuda_5ccuda_CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = 0xC8
};

/* "cuda/ccuda.pxd":1552
 * ctypedef CUGPUDirectRDMAWritesOrdering_enum CUGPUDirectRDMAWritesOrdering
 * 
 * cdef enum CUflushGPUDirectRDMAWritesScope_enum:             # <<<<<<<<<<<<<<
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = 100
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 200
 */
enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesScope_enum {
  __pyx_e_4cuda_5ccuda_CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = 0x64,
  __pyx_e_4cuda_5ccuda_CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 0xC8
};

/* "cuda/ccuda.pxd":1558
 * ctypedef CUflushGPUDirectRDMAWritesScope_enum CUflushGPUDirectRDMAWritesScope
 * 
 * cdef enum CUflushGPUDirectRDMAWritesTarget_enum:             # <<<<<<<<<<<<<<
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesTarget_enum {
  __pyx_e_4cuda_5ccuda_CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0
};

/* "cuda/ccuda.pxd":1563
 * ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget
 * 
 * cdef enum CUgraphDebugDot_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = 1<<0
 *     CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = 1<<1
 */
enum __pyx_t_4cuda_5ccuda_CUgraphDebugDot_flags_enum {

  /* "cuda/ccuda.pxd":1576
 *     CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = 1<<10
 *     CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = 1<<11
 *     CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = 1<<12             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags
 */
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = (1 << 0),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = (1 << 1),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = (1 << 2),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS = (1 << 3),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS = (1 << 4),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS = (1 << 5),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS = (1 << 6),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS = (1 << 7),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS = (1 << 8),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES = (1 << 9),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = (1 << 10),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = (1 << 11),
  __pyx_e_4cuda_5ccuda_CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = (1 << 12)
};

/* "cuda/ccuda.pxd":1580
 * ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags
 * 
 * cdef enum CUuserObject_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUuserObject_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1
};

/* "cuda/ccuda.pxd":1585
 * ctypedef CUuserObject_flags_enum CUuserObject_flags
 * 
 * cdef enum CUuserObjectRetain_flags_enum:             # <<<<<<<<<<<<<<
 *     CU_GRAPH_USER_OBJECT_MOVE = 1
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUuserObjectRetain_flags_enum {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_USER_OBJECT_MOVE = 1
};

/* "cuda/ccuda.pxd":1590
 * ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags
 * 
 * cdef enum CUgraphInstantiate_flags_enum:             # <<<<<<<<<<<<<<
 *     CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1
 * 
 */
enum __pyx_t_4cuda_5ccuda_CUgraphInstantiate_flags_enum {
  __pyx_e_4cuda_5ccuda_CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1
};

/* "cuda/ccuda.pxd":2295
 * cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) nogil except ?CUDA_ERROR_NOT_FOUND
 * 
 * cdef enum: CUDA_VERSION = 11050             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_VERSION = 0x2B2A
};

/* "cuda/ccuda.pxd":2297
 * cdef enum: CUDA_VERSION = 11050
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_LEGACY = 0x1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_IPC_HANDLE_SIZE = 64
};

/* "cuda/ccuda.pxd":2299
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 * 
 * cdef enum: CU_STREAM_LEGACY = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_PER_THREAD = 0x2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_LEGACY = 0x1
};

/* "cuda/ccuda.pxd":2301
 * cdef enum: CU_STREAM_LEGACY = 0x1
 * 
 * cdef enum: CU_STREAM_PER_THREAD = 0x2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_PER_THREAD = 0x2
};

/* "cuda/ccuda.pxd":2303
 * cdef enum: CU_STREAM_PER_THREAD = 0x2
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_PORTABLE = 0x01
};

/* "cuda/ccuda.pxd":2305
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 0x01
 * 
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 0x04
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_DEVICEMAP = 0x02
};

/* "cuda/ccuda.pxd":2307
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 0x02
 * 
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_WRITECOMBINED = 0x04
};

/* "cuda/ccuda.pxd":2309
 * cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 0x04
 * 
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_PORTABLE = 0x01
};

/* "cuda/ccuda.pxd":2311
 * cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 0x01
 * 
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 0x04
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_DEVICEMAP = 0x02
};

/* "cuda/ccuda.pxd":2313
 * cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 0x02
 * 
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 0x08
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_IOMEMORY = 0x04
};

/* "cuda/ccuda.pxd":2315
 * cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 0x04
 * 
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 0x08             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 0x1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTREGISTER_READ_ONLY = 0x08
};

/* "cuda/ccuda.pxd":2317
 * cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 0x08
 * 
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 0x1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 0x1
};

/* "cuda/ccuda.pxd":2319
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 0x1
 * 
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_DEDICATED = 0x1
};

/* "cuda/ccuda.pxd":2321
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 0x1
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 0x01
};

/* "cuda/ccuda.pxd":2323
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 0x01
 * 
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 0x1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 0x02
};

/* "cuda/ccuda.pxd":2325
 * cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 0x02
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 0x2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_NVSCISYNC_ATTR_SIGNAL = 0x1
};

/* "cuda/ccuda.pxd":2327
 * cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 0x1
 * 
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 0x2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 0x1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_NVSCISYNC_ATTR_WAIT = 0x2
};

/* "cuda/ccuda.pxd":2329
 * cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 0x2
 * 
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEM_CREATE_USAGE_TILE_POOL = 0x1
};

/* "cuda/ccuda.pxd":2331
 * cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 0x1
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 0x01
};

/* "cuda/ccuda.pxd":2333
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 0x01
 * 
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_LAYERED = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 0x02
};

/* "cuda/ccuda.pxd":2335
 * cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 0x02
 * 
 * cdef enum: CUDA_ARRAY3D_LAYERED = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_LAYERED = 0x01
};

/* "cuda/ccuda.pxd":2337
 * cdef enum: CUDA_ARRAY3D_LAYERED = 0x01
 * 
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_2DARRAY = 0x01
};

/* "cuda/ccuda.pxd":2339
 * cdef enum: CUDA_ARRAY3D_2DARRAY = 0x01
 * 
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 0x04
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_SURFACE_LDST = 0x02
};

/* "cuda/ccuda.pxd":2341
 * cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 0x02
 * 
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 0x08
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_CUBEMAP = 0x04
};

/* "cuda/ccuda.pxd":2343
 * cdef enum: CUDA_ARRAY3D_CUBEMAP = 0x04
 * 
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 0x08             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 0x10
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_TEXTURE_GATHER = 0x08
};

/* "cuda/ccuda.pxd":2345
 * cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 0x08
 * 
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 0x10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 0x20
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_DEPTH_TEXTURE = 0x10
};

/* "cuda/ccuda.pxd":2347
 * cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 0x10
 * 
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 0x20             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_ARRAY3D_SPARSE = 0x40
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_COLOR_ATTACHMENT = 0x20
};

/* "cuda/ccuda.pxd":2349
 * cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 0x20
 * 
 * cdef enum: CUDA_ARRAY3D_SPARSE = 0x40             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_ARRAY3D_SPARSE = 0x40
};

/* "cuda/ccuda.pxd":2351
 * cdef enum: CUDA_ARRAY3D_SPARSE = 0x40
 * 
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSA_OVERRIDE_FORMAT = 0x01
};

/* "cuda/ccuda.pxd":2353
 * cdef enum: CU_TRSA_OVERRIDE_FORMAT = 0x01
 * 
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_READ_AS_INTEGER = 0x01
};

/* "cuda/ccuda.pxd":2355
 * cdef enum: CU_TRSF_READ_AS_INTEGER = 0x01
 * 
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_SRGB = 0x10
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_NORMALIZED_COORDINATES = 0x02
};

/* "cuda/ccuda.pxd":2357
 * cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 0x02
 * 
 * cdef enum: CU_TRSF_SRGB = 0x10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 0x20
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_SRGB = 0x10
};

/* "cuda/ccuda.pxd":2359
 * cdef enum: CU_TRSF_SRGB = 0x10
 * 
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 0x20             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_END = 0x00
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 0x20
};

/* "cuda/ccuda.pxd":2361
 * cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 0x20
 * 
 * cdef enum: CU_LAUNCH_PARAM_END = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 0x01
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_END = 0x00
};

/* "cuda/ccuda.pxd":2363
 * cdef enum: CU_LAUNCH_PARAM_END = 0x00
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 0x02
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_POINTER = 0x01
};

/* "cuda/ccuda.pxd":2365
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 0x01
 * 
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_PARAM_TR_DEFAULT = -1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_LAUNCH_PARAM_BUFFER_SIZE = 0x02
};

/* "cuda/ccuda.pxd":2367
 * cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 0x02
 * 
 * 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":2369
 * 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":2371
 * cdef enum: CU_DEVICE_CPU = -1
 * 
 * cdef enum: CU_DEVICE_INVALID = -2             # <<<<<<<<<<<<<<
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_INVALID = -2L
};

/* "cuda/ccuda.pxd":26
 *     cdef struct CUctx_st:
 *         pass
 * ctypedef CUctx_st* CUcontext             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUctx_st *__pyx_t_4cuda_5ccuda_CUcontext;

/* "cuda/ccuda.pxd":31
 *     cdef struct CUmod_st:
 *         pass
 * ctypedef CUmod_st* CUmodule             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUmod_st *__pyx_t_4cuda_5ccuda_CUmodule;

/* "cuda/ccuda.pxd":36
 *     cdef struct CUfunc_st:
 *         pass
 * ctypedef CUfunc_st* CUfunction             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUfunc_st *__pyx_t_4cuda_5ccuda_CUfunction;

/* "cuda/ccuda.pxd":41
 *     cdef struct CUarray_st:
 *         pass
 * ctypedef CUarray_st* CUarray             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUarray_st *__pyx_t_4cuda_5ccuda_CUarray;

/* "cuda/ccuda.pxd":46
 *     cdef struct CUmipmappedArray_st:
 *         pass
 * ctypedef CUmipmappedArray_st* CUmipmappedArray             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUmipmappedArray_st *__pyx_t_4cuda_5ccuda_CUmipmappedArray;

/* "cuda/ccuda.pxd":51
 *     cdef struct CUtexref_st:
 *         pass
 * ctypedef CUtexref_st* CUtexref             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUtexref_st *__pyx_t_4cuda_5ccuda_CUtexref;

/* "cuda/ccuda.pxd":56
 *     cdef struct CUsurfref_st:
 *         pass
 * ctypedef CUsurfref_st* CUsurfref             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUsurfref_st *__pyx_t_4cuda_5ccuda_CUsurfref;

/* "cuda/ccuda.pxd":61
 *     cdef struct CUevent_st:
 *         pass
 * ctypedef CUevent_st* CUevent             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUevent_st *__pyx_t_4cuda_5ccuda_CUevent;

/* "cuda/ccuda.pxd":66
 *     cdef struct CUstream_st:
 *         pass
 * ctypedef CUstream_st* CUstream             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUstream_st *__pyx_t_4cuda_5ccuda_CUstream;

/* "cuda/ccuda.pxd":71
 *     cdef struct CUgraphicsResource_st:
 *         pass
 * ctypedef CUgraphicsResource_st* CUgraphicsResource             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long CUtexObject_v1
 */
typedef struct CUgraphicsResource_st *__pyx_t_4cuda_5ccuda_CUgraphicsResource;

/* "cuda/ccuda.pxd":84
 *     cdef struct CUextMemory_st:
 *         pass
 * ctypedef CUextMemory_st* CUexternalMemory             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUextMemory_st *__pyx_t_4cuda_5ccuda_CUexternalMemory;

/* "cuda/ccuda.pxd":89
 *     cdef struct CUextSemaphore_st:
 *         pass
 * ctypedef CUextSemaphore_st* CUexternalSemaphore             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUextSemaphore_st *__pyx_t_4cuda_5ccuda_CUexternalSemaphore;

/* "cuda/ccuda.pxd":94
 *     cdef struct CUgraph_st:
 *         pass
 * ctypedef CUgraph_st* CUgraph             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUgraph_st *__pyx_t_4cuda_5ccuda_CUgraph;

/* "cuda/ccuda.pxd":99
 *     cdef struct CUgraphNode_st:
 *         pass
 * ctypedef CUgraphNode_st* CUgraphNode             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUgraphNode_st *__pyx_t_4cuda_5ccuda_CUgraphNode;

/* "cuda/ccuda.pxd":104
 *     cdef struct CUgraphExec_st:
 *         pass
 * ctypedef CUgraphExec_st* CUgraphExec             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUgraphExec_st *__pyx_t_4cuda_5ccuda_CUgraphExec;

/* "cuda/ccuda.pxd":109
 *     cdef struct CUmemPoolHandle_st:
 *         pass
 * ctypedef CUmemPoolHandle_st* CUmemoryPool             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUmemPoolHandle_st *__pyx_t_4cuda_5ccuda_CUmemoryPool;

/* "cuda/ccuda.pxd":114
 *     cdef struct CUuserObject_st:
 *         pass
 * ctypedef CUuserObject_st* CUuserObject             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUuuid_st:
 */
typedef struct CUuserObject_st *__pyx_t_4cuda_5ccuda_CUuserObject;

/* "cuda/ccuda.pxd":116
 * ctypedef CUuserObject_st* CUuserObject
 * 
 * cdef struct CUuuid_st:             # <<<<<<<<<<<<<<
 *     char bytes[16]
 * 
 */
struct __pyx_t_4cuda_5ccuda_CUuuid_st {
  char bytes[16];
};

/* "cuda/ccuda.pxd":119
 *     char bytes[16]
 * 
 * ctypedef CUuuid_st CUuuid             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUipcEventHandle_st:
 */
typedef struct __pyx_t_4cuda_5ccuda_CUuuid_st __pyx_t_4cuda_5ccuda_CUuuid;

/* "cuda/ccuda.pxd":121
 * ctypedef CUuuid_st CUuuid
 * 
 * cdef struct CUipcEventHandle_st:             # <<<<<<<<<<<<<<
 *     char reserved[64]
 * 
 */
struct __pyx_t_4cuda_5ccuda_CUipcEventHandle_st {
  char reserved[64];
};

/* "cuda/ccuda.pxd":124
 *     char reserved[64]
 * 
 * ctypedef CUipcEventHandle_st CUipcEventHandle_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUipcEventHandle_v1 CUipcEventHandle
 */
typedef struct __pyx_t_4cuda_5ccuda_CUipcEventHandle_st __pyx_t_4cuda_5ccuda_CUipcEventHandle_v1;

/* "cuda/ccuda.pxd":126
 * ctypedef CUipcEventHandle_st CUipcEventHandle_v1
 * 
 * ctypedef CUipcEventHandle_v1 CUipcEventHandle             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUipcMemHandle_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUipcEventHandle_v1 __pyx_t_4cuda_5ccuda_CUipcEventHandle;

/* "cuda/ccuda.pxd":128
 * ctypedef CUipcEventHandle_v1 CUipcEventHandle
 * 
 * cdef struct CUipcMemHandle_st:             # <<<<<<<<<<<<<<
 *     char reserved[64]
 * 
 */
struct __pyx_t_4cuda_5ccuda_CUipcMemHandle_st {
  char reserved[64];
};

/* "cuda/ccuda.pxd":131
 *     char reserved[64]
 * 
 * ctypedef CUipcMemHandle_st CUipcMemHandle_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUipcMemHandle_v1 CUipcMemHandle
 */
typedef struct __pyx_t_4cuda_5ccuda_CUipcMemHandle_st __pyx_t_4cuda_5ccuda_CUipcMemHandle_v1;

/* "cuda/ccuda.pxd":133
 * ctypedef CUipcMemHandle_st CUipcMemHandle_v1
 * 
 * ctypedef CUipcMemHandle_v1 CUipcMemHandle             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUipcMem_flags_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUipcMemHandle_v1 __pyx_t_4cuda_5ccuda_CUipcMemHandle;

/* "cuda/ccuda.pxd":138
 *     CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1
 * 
 * ctypedef CUipcMem_flags_enum CUipcMem_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAttach_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUipcMem_flags_enum __pyx_t_4cuda_5ccuda_CUipcMem_flags;

/* "cuda/ccuda.pxd":145
 *     CU_MEM_ATTACH_SINGLE = 0x4
 * 
 * ctypedef CUmemAttach_flags_enum CUmemAttach_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUctx_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAttach_flags_enum __pyx_t_4cuda_5ccuda_CUmemAttach_flags;

/* "cuda/ccuda.pxd":158
 *     CU_CTX_FLAGS_MASK = 0x1f
 * 
 * ctypedef CUctx_flags_enum CUctx_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstream_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUctx_flags_enum __pyx_t_4cuda_5ccuda_CUctx_flags;

/* "cuda/ccuda.pxd":164
 *     CU_STREAM_NON_BLOCKING = 0x1
 * 
 * ctypedef CUstream_flags_enum CUstream_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUevent_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstream_flags_enum __pyx_t_4cuda_5ccuda_CUstream_flags;

/* "cuda/ccuda.pxd":172
 *     CU_EVENT_INTERPROCESS = 0x4
 * 
 * ctypedef CUevent_flags_enum CUevent_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUevent_record_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUevent_flags_enum __pyx_t_4cuda_5ccuda_CUevent_flags;

/* "cuda/ccuda.pxd":178
 *     CU_EVENT_RECORD_EXTERNAL = 0x1
 * 
 * ctypedef CUevent_record_flags_enum CUevent_record_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUevent_wait_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUevent_record_flags_enum __pyx_t_4cuda_5ccuda_CUevent_record_flags;

/* "cuda/ccuda.pxd":184
 *     CU_EVENT_WAIT_EXTERNAL = 0x1
 * 
 * ctypedef CUevent_wait_flags_enum CUevent_wait_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamWaitValue_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUevent_wait_flags_enum __pyx_t_4cuda_5ccuda_CUevent_wait_flags;

/* "cuda/ccuda.pxd":193
 *     CU_STREAM_WAIT_VALUE_FLUSH = 1<<30
 * 
 * ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamWriteValue_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamWaitValue_flags_enum __pyx_t_4cuda_5ccuda_CUstreamWaitValue_flags;

/* "cuda/ccuda.pxd":199
 *     CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 0x1
 * 
 * ctypedef CUstreamWriteValue_flags_enum CUstreamWriteValue_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamBatchMemOpType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamWriteValue_flags_enum __pyx_t_4cuda_5ccuda_CUstreamWriteValue_flags;

/* "cuda/ccuda.pxd":208
 *     CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3
 * 
 * ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUstreamMemOpWaitValueParams_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType_enum __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType;

/* "cuda/ccuda.pxd":210
 * ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType
 * 
 * cdef struct CUstreamMemOpWaitValueParams_st:             # <<<<<<<<<<<<<<
 *     CUstreamBatchMemOpType operation
 *     CUdeviceptr address
 */
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWaitValueParams_st {
  __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType operation;
  __pyx_t_4cuda_5ccuda_CUdeviceptr address;
  __pyx_t_4cuda_5ccuda_cuuint64_t value64;
  unsigned int flags;
  __pyx_t_4cuda_5ccuda_CUdeviceptr alias;
};

/* "cuda/ccuda.pxd":217
 *     CUdeviceptr alias
 * 
 * cdef struct CUstreamMemOpWriteValueParams_st:             # <<<<<<<<<<<<<<
 *     CUstreamBatchMemOpType operation
 *     CUdeviceptr address
 */
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWriteValueParams_st {
  __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType operation;
  __pyx_t_4cuda_5ccuda_CUdeviceptr address;
  __pyx_t_4cuda_5ccuda_cuuint64_t value64;
  unsigned int flags;
  __pyx_t_4cuda_5ccuda_CUdeviceptr alias;
};

/* "cuda/ccuda.pxd":224
 *     CUdeviceptr alias
 * 
 * cdef struct CUstreamMemOpFlushRemoteWritesParams_st:             # <<<<<<<<<<<<<<
 *     CUstreamBatchMemOpType operation
 *     unsigned int flags
 */
struct __pyx_t_4cuda_5ccuda_CUstreamMemOpFlushRemoteWritesParams_st {
  __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType operation;
  unsigned int flags;
};

/* "cuda/ccuda.pxd":228
 *     unsigned int flags
 * 
 * cdef union CUstreamBatchMemOpParams_union:             # <<<<<<<<<<<<<<
 *     CUstreamBatchMemOpType operation
 *     CUstreamMemOpWaitValueParams_st waitValue
 */
union __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams_union {
  __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpType operation;
  struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWaitValueParams_st waitValue;
  struct __pyx_t_4cuda_5ccuda_CUstreamMemOpWriteValueParams_st writeValue;
  struct __pyx_t_4cuda_5ccuda_CUstreamMemOpFlushRemoteWritesParams_st flushRemoteWrites;
  __pyx_t_4cuda_5ccuda_cuuint64_t pad[6];
};

/* "cuda/ccuda.pxd":235
 *     cuuint64_t pad[6]
 * 
 * ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams
 */
typedef union __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams_union __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams_v1;

/* "cuda/ccuda.pxd":237
 * ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1
 * 
 * ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUoccupancy_flags_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams_v1 __pyx_t_4cuda_5ccuda_CUstreamBatchMemOpParams;

/* "cuda/ccuda.pxd":243
 *     CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1
 * 
 * ctypedef CUoccupancy_flags_enum CUoccupancy_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamUpdateCaptureDependencies_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUoccupancy_flags_enum __pyx_t_4cuda_5ccuda_CUoccupancy_flags;

/* "cuda/ccuda.pxd":249
 *     CU_STREAM_SET_CAPTURE_DEPENDENCIES = 0x1
 * 
 * ctypedef CUstreamUpdateCaptureDependencies_flags_enum CUstreamUpdateCaptureDependencies_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUarray_format_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamUpdateCaptureDependencies_flags_enum __pyx_t_4cuda_5ccuda_CUstreamUpdateCaptureDependencies_flags;

/* "cuda/ccuda.pxd":288
 *     CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e
 * 
 * ctypedef CUarray_format_enum CUarray_format             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUaddress_mode_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUarray_format_enum __pyx_t_4cuda_5ccuda_CUarray_format;

/* "cuda/ccuda.pxd":296
 *     CU_TR_ADDRESS_MODE_BORDER = 3
 * 
 * ctypedef CUaddress_mode_enum CUaddress_mode             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUfilter_mode_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUaddress_mode_enum __pyx_t_4cuda_5ccuda_CUaddress_mode;

/* "cuda/ccuda.pxd":302
 *     CU_TR_FILTER_MODE_LINEAR = 1
 * 
 * ctypedef CUfilter_mode_enum CUfilter_mode             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUdevice_attribute_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUfilter_mode_enum __pyx_t_4cuda_5ccuda_CUfilter_mode;

/* "cuda/ccuda.pxd":432
 *     CU_DEVICE_ATTRIBUTE_MAX
 * 
 * ctypedef CUdevice_attribute_enum CUdevice_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUdevprop_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUdevice_attribute_enum __pyx_t_4cuda_5ccuda_CUdevice_attribute;

/* "cuda/ccuda.pxd":434
 * ctypedef CUdevice_attribute_enum CUdevice_attribute
 * 
 * cdef struct CUdevprop_st:             # <<<<<<<<<<<<<<
 *     int maxThreadsPerBlock
 *     int maxThreadsDim[3]
 */
struct __pyx_t_4cuda_5ccuda_CUdevprop_st {
  int maxThreadsPerBlock;
  int maxThreadsDim[3];
  int maxGridSize[3];
  int sharedMemPerBlock;
  int totalConstantMemory;
  int SIMDWidth;
  int memPitch;
  int regsPerBlock;
  int clockRate;
  int textureAlign;
};

/* "cuda/ccuda.pxd":446
 *     int textureAlign
 * 
 * ctypedef CUdevprop_st CUdevprop_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUdevprop_v1 CUdevprop
 */
typedef struct __pyx_t_4cuda_5ccuda_CUdevprop_st __pyx_t_4cuda_5ccuda_CUdevprop_v1;

/* "cuda/ccuda.pxd":448
 * ctypedef CUdevprop_st CUdevprop_v1
 * 
 * ctypedef CUdevprop_v1 CUdevprop             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUpointer_attribute_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUdevprop_v1 __pyx_t_4cuda_5ccuda_CUdevprop;

/* "cuda/ccuda.pxd":469
 *     CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17
 * 
 * ctypedef CUpointer_attribute_enum CUpointer_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUfunction_attribute_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUpointer_attribute_enum __pyx_t_4cuda_5ccuda_CUpointer_attribute;

/* "cuda/ccuda.pxd":484
 *     CU_FUNC_ATTRIBUTE_MAX
 * 
 * ctypedef CUfunction_attribute_enum CUfunction_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUfunc_cache_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUfunction_attribute_enum __pyx_t_4cuda_5ccuda_CUfunction_attribute;

/* "cuda/ccuda.pxd":492
 *     CU_FUNC_CACHE_PREFER_EQUAL = 0x03
 * 
 * ctypedef CUfunc_cache_enum CUfunc_cache             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUsharedconfig_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUfunc_cache_enum __pyx_t_4cuda_5ccuda_CUfunc_cache;

/* "cuda/ccuda.pxd":499
 *     CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02
 * 
 * ctypedef CUsharedconfig_enum CUsharedconfig             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUshared_carveout_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUsharedconfig_enum __pyx_t_4cuda_5ccuda_CUsharedconfig;

/* "cuda/ccuda.pxd":506
 *     CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0
 * 
 * ctypedef CUshared_carveout_enum CUshared_carveout             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemorytype_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUshared_carveout_enum __pyx_t_4cuda_5ccuda_CUshared_carveout;

/* "cuda/ccuda.pxd":514
 *     CU_MEMORYTYPE_UNIFIED = 0x04
 * 
 * ctypedef CUmemorytype_enum CUmemorytype             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUcomputemode_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemorytype_enum __pyx_t_4cuda_5ccuda_CUmemorytype;

/* "cuda/ccuda.pxd":521
 *     CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3
 * 
 * ctypedef CUcomputemode_enum CUcomputemode             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmem_advise_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUcomputemode_enum __pyx_t_4cuda_5ccuda_CUcomputemode;

/* "cuda/ccuda.pxd":531
 *     CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6
 * 
 * ctypedef CUmem_advise_enum CUmem_advise             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmem_range_attribute_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmem_advise_enum __pyx_t_4cuda_5ccuda_CUmem_advise;

/* "cuda/ccuda.pxd":539
 *     CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4
 * 
 * ctypedef CUmem_range_attribute_enum CUmem_range_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUjit_option_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmem_range_attribute_enum __pyx_t_4cuda_5ccuda_CUmem_range_attribute;

/* "cuda/ccuda.pxd":569
 *     CU_JIT_NUM_OPTIONS
 * 
 * ctypedef CUjit_option_enum CUjit_option             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUjit_target_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUjit_option_enum __pyx_t_4cuda_5ccuda_CUjit_option;

/* "cuda/ccuda.pxd":590
 *     CU_TARGET_COMPUTE_86 = 86
 * 
 * ctypedef CUjit_target_enum CUjit_target             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUjit_fallback_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUjit_target_enum __pyx_t_4cuda_5ccuda_CUjit_target;

/* "cuda/ccuda.pxd":596
 *     CU_PREFER_BINARY
 * 
 * ctypedef CUjit_fallback_enum CUjit_fallback             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUjit_cacheMode_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUjit_fallback_enum __pyx_t_4cuda_5ccuda_CUjit_fallback;

/* "cuda/ccuda.pxd":603
 *     CU_JIT_CACHE_OPTION_CA
 * 
 * ctypedef CUjit_cacheMode_enum CUjit_cacheMode             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUjitInputType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUjit_cacheMode_enum __pyx_t_4cuda_5ccuda_CUjit_cacheMode;

/* "cuda/ccuda.pxd":614
 *     CU_JIT_NUM_INPUT_TYPES
 * 
 * ctypedef CUjitInputType_enum CUjitInputType             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef enum __pyx_t_4cuda_5ccuda_CUjitInputType_enum __pyx_t_4cuda_5ccuda_CUjitInputType;

/* "cuda/ccuda.pxd":619
 *     cdef struct CUlinkState_st:
 *         pass
 * ctypedef CUlinkState_st* CUlinkState             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphicsRegisterFlags_enum:
 */
typedef struct CUlinkState_st *__pyx_t_4cuda_5ccuda_CUlinkState;

/* "cuda/ccuda.pxd":628
 *     CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08
 * 
 * ctypedef CUgraphicsRegisterFlags_enum CUgraphicsRegisterFlags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphicsMapResourceFlags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphicsRegisterFlags_enum __pyx_t_4cuda_5ccuda_CUgraphicsRegisterFlags;

/* "cuda/ccuda.pxd":635
 *     CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02
 * 
 * ctypedef CUgraphicsMapResourceFlags_enum CUgraphicsMapResourceFlags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUarray_cubemap_face_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphicsMapResourceFlags_enum __pyx_t_4cuda_5ccuda_CUgraphicsMapResourceFlags;

/* "cuda/ccuda.pxd":645
 *     CU_CUBEMAP_FACE_NEGATIVE_Z = 0x05
 * 
 * ctypedef CUarray_cubemap_face_enum CUarray_cubemap_face             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUlimit_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUarray_cubemap_face_enum __pyx_t_4cuda_5ccuda_CUarray_cubemap_face;

/* "cuda/ccuda.pxd":657
 *     CU_LIMIT_MAX
 * 
 * ctypedef CUlimit_enum CUlimit             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUresourcetype_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUlimit_enum __pyx_t_4cuda_5ccuda_CUlimit;

/* "cuda/ccuda.pxd":665
 *     CU_RESOURCE_TYPE_PITCH2D = 0x03
 * 
 * ctypedef CUresourcetype_enum CUresourcetype             # <<<<<<<<<<<<<<
 * 
 * ctypedef void (*CUhostFn)(void* userData)
 */
typedef enum __pyx_t_4cuda_5ccuda_CUresourcetype_enum __pyx_t_4cuda_5ccuda_CUresourcetype;

/* "cuda/ccuda.pxd":667
 * ctypedef CUresourcetype_enum CUresourcetype
 * 
 * ctypedef void (*CUhostFn)(void* userData)             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUaccessProperty_enum:
 */
typedef void (*__pyx_t_4cuda_5ccuda_CUhostFn)(void *);

/* "cuda/ccuda.pxd":674
 *     CU_ACCESS_PROPERTY_PERSISTING = 2
 * 
 * ctypedef CUaccessProperty_enum CUaccessProperty             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUaccessPolicyWindow_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUaccessProperty_enum __pyx_t_4cuda_5ccuda_CUaccessProperty;

/* "cuda/ccuda.pxd":676
 * ctypedef CUaccessProperty_enum CUaccessProperty
 * 
 * cdef struct CUaccessPolicyWindow_st:             # <<<<<<<<<<<<<<
 *     void* base_ptr
 *     size_t num_bytes
 */
struct __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow_st {
  void *base_ptr;
  size_t num_bytes;
  float hitRatio;
  __pyx_t_4cuda_5ccuda_CUaccessProperty hitProp;
  __pyx_t_4cuda_5ccuda_CUaccessProperty missProp;
};

/* "cuda/ccuda.pxd":683
 *     CUaccessProperty missProp
 * 
 * ctypedef CUaccessPolicyWindow_st CUaccessPolicyWindow_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow
 */
typedef struct __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow_st __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow_v1;

/* "cuda/ccuda.pxd":685
 * ctypedef CUaccessPolicyWindow_st CUaccessPolicyWindow_v1
 * 
 * ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_KERNEL_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow_v1 __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow;

/* "cuda/ccuda.pxd":687
 * ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow
 * 
 * cdef struct CUDA_KERNEL_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUfunction func
 *     unsigned int gridDimX
 */
struct __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUfunction func;
  unsigned int gridDimX;
  unsigned int gridDimY;
  unsigned int gridDimZ;
  unsigned int blockDimX;
  unsigned int blockDimY;
  unsigned int blockDimZ;
  unsigned int sharedMemBytes;
  void **kernelParams;
  void **extra;
};

/* "cuda/ccuda.pxd":699
 *     void** extra
 * 
 * ctypedef CUDA_KERNEL_NODE_PARAMS_st CUDA_KERNEL_NODE_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_KERNEL_NODE_PARAMS_v1 CUDA_KERNEL_NODE_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS_v1;

/* "cuda/ccuda.pxd":701
 * ctypedef CUDA_KERNEL_NODE_PARAMS_st CUDA_KERNEL_NODE_PARAMS_v1
 * 
 * ctypedef CUDA_KERNEL_NODE_PARAMS_v1 CUDA_KERNEL_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_MEMSET_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS;

/* "cuda/ccuda.pxd":703
 * ctypedef CUDA_KERNEL_NODE_PARAMS_v1 CUDA_KERNEL_NODE_PARAMS
 * 
 * cdef struct CUDA_MEMSET_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUdeviceptr dst
 *     size_t pitch
 */
struct __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUdeviceptr dst;
  size_t pitch;
  unsigned int value;
  unsigned int elementSize;
  size_t width;
  size_t height;
};

/* "cuda/ccuda.pxd":711
 *     size_t height
 * 
 * ctypedef CUDA_MEMSET_NODE_PARAMS_st CUDA_MEMSET_NODE_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS_v1;

/* "cuda/ccuda.pxd":713
 * ctypedef CUDA_MEMSET_NODE_PARAMS_st CUDA_MEMSET_NODE_PARAMS_v1
 * 
 * ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_HOST_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS;

/* "cuda/ccuda.pxd":715
 * ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS
 * 
 * cdef struct CUDA_HOST_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUhostFn fn
 *     void* userData
 */
struct __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUhostFn fn;
  void *userData;
};

/* "cuda/ccuda.pxd":719
 *     void* userData
 * 
 * ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS_v1;

/* "cuda/ccuda.pxd":721
 * ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1
 * 
 * ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphNodeType_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_HOST_NODE_PARAMS;

/* "cuda/ccuda.pxd":737
 *     CU_GRAPH_NODE_TYPE_MEM_FREE = 11
 * 
 * ctypedef CUgraphNodeType_enum CUgraphNodeType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUsynchronizationPolicy_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphNodeType_enum __pyx_t_4cuda_5ccuda_CUgraphNodeType;

/* "cuda/ccuda.pxd":745
 *     CU_SYNC_POLICY_BLOCKING_SYNC = 4
 * 
 * ctypedef CUsynchronizationPolicy_enum CUsynchronizationPolicy             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUkernelNodeAttrID_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUsynchronizationPolicy_enum __pyx_t_4cuda_5ccuda_CUsynchronizationPolicy;

/* "cuda/ccuda.pxd":751
 *     CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
 * 
 * ctypedef CUkernelNodeAttrID_enum CUkernelNodeAttrID             # <<<<<<<<<<<<<<
 * 
 * cdef union CUkernelNodeAttrValue_union:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUkernelNodeAttrID_enum __pyx_t_4cuda_5ccuda_CUkernelNodeAttrID;

/* "cuda/ccuda.pxd":753
 * ctypedef CUkernelNodeAttrID_enum CUkernelNodeAttrID
 * 
 * cdef union CUkernelNodeAttrValue_union:             # <<<<<<<<<<<<<<
 *     CUaccessPolicyWindow accessPolicyWindow
 *     int cooperative
 */
union __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue_union {
  __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow accessPolicyWindow;
  int cooperative;
};

/* "cuda/ccuda.pxd":757
 *     int cooperative
 * 
 * ctypedef CUkernelNodeAttrValue_union CUkernelNodeAttrValue_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue
 */
typedef union __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue_union __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue_v1;

/* "cuda/ccuda.pxd":759
 * ctypedef CUkernelNodeAttrValue_union CUkernelNodeAttrValue_v1
 * 
 * ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamCaptureStatus_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue_v1 __pyx_t_4cuda_5ccuda_CUkernelNodeAttrValue;

/* "cuda/ccuda.pxd":766
 *     CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2
 * 
 * ctypedef CUstreamCaptureStatus_enum CUstreamCaptureStatus             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamCaptureMode_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamCaptureStatus_enum __pyx_t_4cuda_5ccuda_CUstreamCaptureStatus;

/* "cuda/ccuda.pxd":773
 *     CU_STREAM_CAPTURE_MODE_RELAXED = 2
 * 
 * ctypedef CUstreamCaptureMode_enum CUstreamCaptureMode             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUstreamAttrID_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamCaptureMode_enum __pyx_t_4cuda_5ccuda_CUstreamCaptureMode;

/* "cuda/ccuda.pxd":779
 *     CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 * 
 * ctypedef CUstreamAttrID_enum CUstreamAttrID             # <<<<<<<<<<<<<<
 * 
 * cdef union CUstreamAttrValue_union:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUstreamAttrID_enum __pyx_t_4cuda_5ccuda_CUstreamAttrID;

/* "cuda/ccuda.pxd":781
 * ctypedef CUstreamAttrID_enum CUstreamAttrID
 * 
 * cdef union CUstreamAttrValue_union:             # <<<<<<<<<<<<<<
 *     CUaccessPolicyWindow accessPolicyWindow
 *     CUsynchronizationPolicy syncPolicy
 */
union __pyx_t_4cuda_5ccuda_CUstreamAttrValue_union {
  __pyx_t_4cuda_5ccuda_CUaccessPolicyWindow accessPolicyWindow;
  __pyx_t_4cuda_5ccuda_CUsynchronizationPolicy syncPolicy;
};

/* "cuda/ccuda.pxd":785
 *     CUsynchronizationPolicy syncPolicy
 * 
 * ctypedef CUstreamAttrValue_union CUstreamAttrValue_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUstreamAttrValue_v1 CUstreamAttrValue
 */
typedef union __pyx_t_4cuda_5ccuda_CUstreamAttrValue_union __pyx_t_4cuda_5ccuda_CUstreamAttrValue_v1;

/* "cuda/ccuda.pxd":787
 * ctypedef CUstreamAttrValue_union CUstreamAttrValue_v1
 * 
 * ctypedef CUstreamAttrValue_v1 CUstreamAttrValue             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUdriverProcAddress_flags_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUstreamAttrValue_v1 __pyx_t_4cuda_5ccuda_CUstreamAttrValue;

/* "cuda/ccuda.pxd":794
 *     CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = 1 << 1
 * 
 * ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUexecAffinityType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUdriverProcAddress_flags_enum __pyx_t_4cuda_5ccuda_CUdriverProcAddress_flags;

/* "cuda/ccuda.pxd":800
 *     CU_EXEC_AFFINITY_TYPE_MAX
 * 
 * ctypedef CUexecAffinityType_enum CUexecAffinityType             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUexecAffinitySmCount_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUexecAffinityType_enum __pyx_t_4cuda_5ccuda_CUexecAffinityType;

/* "cuda/ccuda.pxd":802
 * ctypedef CUexecAffinityType_enum CUexecAffinityType
 * 
 * cdef struct CUexecAffinitySmCount_st:             # <<<<<<<<<<<<<<
 *     unsigned int val
 * 
 */
struct __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount_st {
  unsigned int val;
};

/* "cuda/ccuda.pxd":805
 *     unsigned int val
 * 
 * ctypedef CUexecAffinitySmCount_st CUexecAffinitySmCount_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount
 */
typedef struct __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount_st __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount_v1;

/* "cuda/ccuda.pxd":807
 * ctypedef CUexecAffinitySmCount_st CUexecAffinitySmCount_v1
 * 
 * ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount             # <<<<<<<<<<<<<<
 * 
 * cdef union _CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u:
 */
typedef __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount_v1 __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount;

/* "cuda/ccuda.pxd":809
 * ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount
 * 
 * cdef union _CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u:             # <<<<<<<<<<<<<<
 *     CUexecAffinitySmCount smCount
 * 
 */
union __pyx_t_4cuda_5ccuda__CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u {
  __pyx_t_4cuda_5ccuda_CUexecAffinitySmCount smCount;
};

/* "cuda/ccuda.pxd":812
 *     CUexecAffinitySmCount smCount
 * 
 * cdef struct CUexecAffinityParam_st:             # <<<<<<<<<<<<<<
 *     CUexecAffinityType type
 *     _CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u param
 */
struct __pyx_t_4cuda_5ccuda_CUexecAffinityParam_st {
  __pyx_t_4cuda_5ccuda_CUexecAffinityType type;
  union __pyx_t_4cuda_5ccuda__CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u param;
};

/* "cuda/ccuda.pxd":816
 *     _CUexecAffinityParam_v1_CUexecAffinityParam_v1_CUexecAffinityParam_st_param_u param
 * 
 * ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUexecAffinityParam_v1 CUexecAffinityParam
 */
typedef struct __pyx_t_4cuda_5ccuda_CUexecAffinityParam_st __pyx_t_4cuda_5ccuda_CUexecAffinityParam_v1;

/* "cuda/ccuda.pxd":818
 * ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1
 * 
 * ctypedef CUexecAffinityParam_v1 CUexecAffinityParam             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaError_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUexecAffinityParam_v1 __pyx_t_4cuda_5ccuda_CUexecAffinityParam;

/* "cuda/ccuda.pxd":909
 *     CUDA_ERROR_UNKNOWN = 999
 * 
 * ctypedef cudaError_enum CUresult             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUdevice_P2PAttribute_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_cudaError_enum __pyx_t_4cuda_5ccuda_CUresult;

/* "cuda/ccuda.pxd":918
 *     CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 0x04
 * 
 * ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute             # <<<<<<<<<<<<<<
 * 
 * ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData)
 */
typedef enum __pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute_enum __pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute;

/* "cuda/ccuda.pxd":920
 * ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute
 * 
 * ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData)             # <<<<<<<<<<<<<<
 * 
 * ctypedef size_t (*CUoccupancyB2DSize)(int blockSize)
 */
typedef void (*__pyx_t_4cuda_5ccuda_CUstreamCallback)(__pyx_t_4cuda_5ccuda_CUstream, __pyx_t_4cuda_5ccuda_CUresult, void *);

/* "cuda/ccuda.pxd":922
 * ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData)
 * 
 * ctypedef size_t (*CUoccupancyB2DSize)(int blockSize)             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_MEMCPY2D_st:
 */
typedef size_t (*__pyx_t_4cuda_5ccuda_CUoccupancyB2DSize)(int);

/* "cuda/ccuda.pxd":924
 * ctypedef size_t (*CUoccupancyB2DSize)(int blockSize)
 * 
 * cdef struct CUDA_MEMCPY2D_st:             # <<<<<<<<<<<<<<
 *     size_t srcXInBytes
 *     size_t srcY
 */
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D_st {
  size_t srcXInBytes;
  size_t srcY;
  __pyx_t_4cuda_5ccuda_CUmemorytype srcMemoryType;
  void const *srcHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr srcDevice;
  __pyx_t_4cuda_5ccuda_CUarray srcArray;
  size_t srcPitch;
  size_t dstXInBytes;
  size_t dstY;
  __pyx_t_4cuda_5ccuda_CUmemorytype dstMemoryType;
  void *dstHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr dstDevice;
  __pyx_t_4cuda_5ccuda_CUarray dstArray;
  size_t dstPitch;
  size_t WidthInBytes;
  size_t Height;
};

/* "cuda/ccuda.pxd":942
 *     size_t Height
 * 
 * ctypedef CUDA_MEMCPY2D_st CUDA_MEMCPY2D_v2             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D_st __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D_v2;

/* "cuda/ccuda.pxd":944
 * ctypedef CUDA_MEMCPY2D_st CUDA_MEMCPY2D_v2
 * 
 * ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_MEMCPY3D_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D_v2 __pyx_t_4cuda_5ccuda_CUDA_MEMCPY2D;

/* "cuda/ccuda.pxd":946
 * ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D
 * 
 * cdef struct CUDA_MEMCPY3D_st:             # <<<<<<<<<<<<<<
 *     size_t srcXInBytes
 *     size_t srcY
 */
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_st {
  size_t srcXInBytes;
  size_t srcY;
  size_t srcZ;
  size_t srcLOD;
  __pyx_t_4cuda_5ccuda_CUmemorytype srcMemoryType;
  void const *srcHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr srcDevice;
  __pyx_t_4cuda_5ccuda_CUarray srcArray;
  void *reserved0;
  size_t srcPitch;
  size_t srcHeight;
  size_t dstXInBytes;
  size_t dstY;
  size_t dstZ;
  size_t dstLOD;
  __pyx_t_4cuda_5ccuda_CUmemorytype dstMemoryType;
  void *dstHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr dstDevice;
  __pyx_t_4cuda_5ccuda_CUarray dstArray;
  void *reserved1;
  size_t dstPitch;
  size_t dstHeight;
  size_t WidthInBytes;
  size_t Height;
  size_t Depth;
};

/* "cuda/ccuda.pxd":973
 *     size_t Depth
 * 
 * ctypedef CUDA_MEMCPY3D_st CUDA_MEMCPY3D_v2             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_st __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2;

/* "cuda/ccuda.pxd":975
 * ctypedef CUDA_MEMCPY3D_st CUDA_MEMCPY3D_v2
 * 
 * ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_MEMCPY3D_PEER_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D;

/* "cuda/ccuda.pxd":977
 * ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D
 * 
 * cdef struct CUDA_MEMCPY3D_PEER_st:             # <<<<<<<<<<<<<<
 *     size_t srcXInBytes
 *     size_t srcY
 */
struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER_st {
  size_t srcXInBytes;
  size_t srcY;
  size_t srcZ;
  size_t srcLOD;
  __pyx_t_4cuda_5ccuda_CUmemorytype srcMemoryType;
  void const *srcHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr srcDevice;
  __pyx_t_4cuda_5ccuda_CUarray srcArray;
  __pyx_t_4cuda_5ccuda_CUcontext srcContext;
  size_t srcPitch;
  size_t srcHeight;
  size_t dstXInBytes;
  size_t dstY;
  size_t dstZ;
  size_t dstLOD;
  __pyx_t_4cuda_5ccuda_CUmemorytype dstMemoryType;
  void *dstHost;
  __pyx_t_4cuda_5ccuda_CUdeviceptr dstDevice;
  __pyx_t_4cuda_5ccuda_CUarray dstArray;
  __pyx_t_4cuda_5ccuda_CUcontext dstContext;
  size_t dstPitch;
  size_t dstHeight;
  size_t WidthInBytes;
  size_t Height;
  size_t Depth;
};

/* "cuda/ccuda.pxd":1004
 *     size_t Depth
 * 
 * ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER_st __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER_v1;

/* "cuda/ccuda.pxd":1006
 * ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1
 * 
 * ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_ARRAY_DESCRIPTOR_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER_v1 __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_PEER;

/* "cuda/ccuda.pxd":1008
 * ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER
 * 
 * cdef struct CUDA_ARRAY_DESCRIPTOR_st:             # <<<<<<<<<<<<<<
 *     size_t Width
 *     size_t Height
 */
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR_st {
  size_t Width;
  size_t Height;
  __pyx_t_4cuda_5ccuda_CUarray_format Format;
  unsigned int NumChannels;
};

/* "cuda/ccuda.pxd":1014
 *     unsigned int NumChannels
 * 
 * ctypedef CUDA_ARRAY_DESCRIPTOR_st CUDA_ARRAY_DESCRIPTOR_v2             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR_st __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR_v2;

/* "cuda/ccuda.pxd":1016
 * ctypedef CUDA_ARRAY_DESCRIPTOR_st CUDA_ARRAY_DESCRIPTOR_v2
 * 
 * ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_ARRAY3D_DESCRIPTOR_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR_v2 __pyx_t_4cuda_5ccuda_CUDA_ARRAY_DESCRIPTOR;

/* "cuda/ccuda.pxd":1018
 * ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR
 * 
 * cdef struct CUDA_ARRAY3D_DESCRIPTOR_st:             # <<<<<<<<<<<<<<
 *     size_t Width
 *     size_t Height
 */
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_st {
  size_t Width;
  size_t Height;
  size_t Depth;
  __pyx_t_4cuda_5ccuda_CUarray_format Format;
  unsigned int NumChannels;
  unsigned int Flags;
};

/* "cuda/ccuda.pxd":1026
 *     unsigned int Flags
 * 
 * ctypedef CUDA_ARRAY3D_DESCRIPTOR_st CUDA_ARRAY3D_DESCRIPTOR_v2             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_st __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_v2;

/* "cuda/ccuda.pxd":1028
 * ctypedef CUDA_ARRAY3D_DESCRIPTOR_st CUDA_ARRAY3D_DESCRIPTOR_v2
 * 
 * ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR;

/* "cuda/ccuda.pxd":1030
 * ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR
 * 
 * cdef struct _CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s:             # <<<<<<<<<<<<<<
 *     unsigned int width
 *     unsigned int height
 */
struct __pyx_t_4cuda_5ccuda__CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s {
  unsigned int width;
  unsigned int height;
  unsigned int depth;
};

/* "cuda/ccuda.pxd":1035
 *     unsigned int depth
 * 
 * cdef struct CUDA_ARRAY_SPARSE_PROPERTIES_st:             # <<<<<<<<<<<<<<
 *     _CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s tileExtent
 *     unsigned int miptailFirstLevel
 */
struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES_st {
  struct __pyx_t_4cuda_5ccuda__CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_v1_CUDA_ARRAY_SPARSE_PROPERTIES_st_tileExtent_s tileExtent;
  unsigned int miptailFirstLevel;
  unsigned PY_LONG_LONG miptailSize;
  unsigned int flags;
  unsigned int reserved[4];
};

/* "cuda/ccuda.pxd":1042
 *     unsigned int reserved[4]
 * 
 * ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES_st __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES_v1;

/* "cuda/ccuda.pxd":1044
 * ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1
 * 
 * ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES_v1 __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES;

/* "cuda/ccuda.pxd":1046
 * ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s:             # <<<<<<<<<<<<<<
 *     CUarray hArray
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s {
  __pyx_t_4cuda_5ccuda_CUarray hArray;
};

/* "cuda/ccuda.pxd":1049
 *     CUarray hArray
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_mipmap_s:             # <<<<<<<<<<<<<<
 *     CUmipmappedArray hMipmappedArray
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_mipmap_s {
  __pyx_t_4cuda_5ccuda_CUmipmappedArray hMipmappedArray;
};

/* "cuda/ccuda.pxd":1052
 *     CUmipmappedArray hMipmappedArray
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_linear_s:             # <<<<<<<<<<<<<<
 *     CUdeviceptr devPtr
 *     CUarray_format format
 */
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_linear_s {
  __pyx_t_4cuda_5ccuda_CUdeviceptr devPtr;
  __pyx_t_4cuda_5ccuda_CUarray_format format;
  unsigned int numChannels;
  size_t sizeInBytes;
};

/* "cuda/ccuda.pxd":1058
 *     size_t sizeInBytes
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_pitch2D_s:             # <<<<<<<<<<<<<<
 *     CUdeviceptr devPtr
 *     CUarray_format format
 */
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_pitch2D_s {
  __pyx_t_4cuda_5ccuda_CUdeviceptr devPtr;
  __pyx_t_4cuda_5ccuda_CUarray_format format;
  unsigned int numChannels;
  size_t width;
  size_t height;
  size_t pitchInBytes;
};

/* "cuda/ccuda.pxd":1066
 *     size_t pitchInBytes
 * 
 * cdef struct _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_reserved_s:             # <<<<<<<<<<<<<<
 *     int reserved[32]
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_reserved_s {
  int reserved[32];
};

/* "cuda/ccuda.pxd":1069
 *     int reserved[32]
 * 
 * cdef union _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_u:             # <<<<<<<<<<<<<<
 *     _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s array
 *     _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_mipmap_s mipmap
 */
union __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_u {
  struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_array_s array;
  struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_mipmap_s mipmap;
  struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_linear_s linear;
  struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_pitch2D_s pitch2D;
  struct __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_reserved_s reserved;
};

/* "cuda/ccuda.pxd":1076
 *     _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_res_reserved_s reserved
 * 
 * cdef struct CUDA_RESOURCE_DESC_st:             # <<<<<<<<<<<<<<
 *     CUresourcetype resType
 *     _CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_u res
 */
struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC_st {
  __pyx_t_4cuda_5ccuda_CUresourcetype resType;
  union __pyx_t_4cuda_5ccuda__CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_v1_CUDA_RESOURCE_DESC_st_res_u res;
  unsigned int flags;
};

/* "cuda/ccuda.pxd":1081
 *     unsigned int flags
 * 
 * ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC_st __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC_v1;

/* "cuda/ccuda.pxd":1083
 * ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1
 * 
 * ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_TEXTURE_DESC_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC;

/* "cuda/ccuda.pxd":1085
 * ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC
 * 
 * cdef struct CUDA_TEXTURE_DESC_st:             # <<<<<<<<<<<<<<
 *     CUaddress_mode addressMode[3]
 *     CUfilter_mode filterMode
 */
struct __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC_st {
  __pyx_t_4cuda_5ccuda_CUaddress_mode addressMode[3];
  __pyx_t_4cuda_5ccuda_CUfilter_mode filterMode;
  unsigned int flags;
  unsigned int maxAnisotropy;
  __pyx_t_4cuda_5ccuda_CUfilter_mode mipmapFilterMode;
  float mipmapLevelBias;
  float minMipmapLevelClamp;
  float maxMipmapLevelClamp;
  float borderColor[4];
  int reserved[12];
};

/* "cuda/ccuda.pxd":1097
 *     int reserved[12]
 * 
 * ctypedef CUDA_TEXTURE_DESC_st CUDA_TEXTURE_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC_st __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC_v1;

/* "cuda/ccuda.pxd":1099
 * ctypedef CUDA_TEXTURE_DESC_st CUDA_TEXTURE_DESC_v1
 * 
 * ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUresourceViewFormat_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC;

/* "cuda/ccuda.pxd":1138
 *     CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22
 * 
 * ctypedef CUresourceViewFormat_enum CUresourceViewFormat             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_RESOURCE_VIEW_DESC_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUresourceViewFormat_enum __pyx_t_4cuda_5ccuda_CUresourceViewFormat;

/* "cuda/ccuda.pxd":1140
 * ctypedef CUresourceViewFormat_enum CUresourceViewFormat
 * 
 * cdef struct CUDA_RESOURCE_VIEW_DESC_st:             # <<<<<<<<<<<<<<
 *     CUresourceViewFormat format
 *     size_t width
 */
struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC_st {
  __pyx_t_4cuda_5ccuda_CUresourceViewFormat format;
  size_t width;
  size_t height;
  size_t depth;
  unsigned int firstMipmapLevel;
  unsigned int lastMipmapLevel;
  unsigned int firstLayer;
  unsigned int lastLayer;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1151
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC_st __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC_v1;

/* "cuda/ccuda.pxd":1153
 * ctypedef CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC_v1
 * 
 * ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC;

/* "cuda/ccuda.pxd":1155
 * ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC
 * 
 * cdef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st:             # <<<<<<<<<<<<<<
 *     unsigned long long p2pToken
 *     unsigned int vaSpaceToken
 */
struct __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
  unsigned PY_LONG_LONG p2pToken;
  unsigned int vaSpaceToken;
};

/* "cuda/ccuda.pxd":1159
 *     unsigned int vaSpaceToken
 * 
 * ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1;

/* "cuda/ccuda.pxd":1161
 * ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1
 * 
 * ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS;

/* "cuda/ccuda.pxd":1168
 *     CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 0x3
 * 
 * ctypedef CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_LAUNCH_PARAMS_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum __pyx_t_4cuda_5ccuda_CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS;

/* "cuda/ccuda.pxd":1170
 * ctypedef CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS
 * 
 * cdef struct CUDA_LAUNCH_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUfunction function
 *     unsigned int gridDimX
 */
struct __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUfunction function;
  unsigned int gridDimX;
  unsigned int gridDimY;
  unsigned int gridDimZ;
  unsigned int blockDimX;
  unsigned int blockDimY;
  unsigned int blockDimZ;
  unsigned int sharedMemBytes;
  __pyx_t_4cuda_5ccuda_CUstream hStream;
  void **kernelParams;
};

/* "cuda/ccuda.pxd":1182
 *     void** kernelParams
 * 
 * ctypedef CUDA_LAUNCH_PARAMS_st CUDA_LAUNCH_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS_v1;

/* "cuda/ccuda.pxd":1184
 * ctypedef CUDA_LAUNCH_PARAMS_st CUDA_LAUNCH_PARAMS_v1
 * 
 * ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUexternalMemoryHandleType_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_LAUNCH_PARAMS;

/* "cuda/ccuda.pxd":1196
 *     CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8
 * 
 * ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUexternalMemoryHandleType_enum __pyx_t_4cuda_5ccuda_CUexternalMemoryHandleType;

/* "cuda/ccuda.pxd":1198
 * ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType
 * 
 * cdef struct _CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s:             # <<<<<<<<<<<<<<
 *     void* handle
 *     void* name
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s {
  void *handle;
  void *name;
};

/* "cuda/ccuda.pxd":1202
 *     void* name
 * 
 * cdef union _CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_u:             # <<<<<<<<<<<<<<
 *     int fd
 *     _CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s win32
 */
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_u {
  int fd;
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_handle_win32_s win32;
  void *nvSciBufObject;
};

/* "cuda/ccuda.pxd":1207
 *     void* nvSciBufObject
 * 
 * cdef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st:             # <<<<<<<<<<<<<<
 *     CUexternalMemoryHandleType type
 *     _CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_u handle
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
  __pyx_t_4cuda_5ccuda_CUexternalMemoryHandleType type;
  union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st_handle_u handle;
  unsigned PY_LONG_LONG size;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1214
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1;

/* "cuda/ccuda.pxd":1216
 * ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC;

/* "cuda/ccuda.pxd":1218
 * ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC
 * 
 * cdef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st:             # <<<<<<<<<<<<<<
 *     unsigned long long offset
 *     unsigned long long size
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
  unsigned PY_LONG_LONG offset;
  unsigned PY_LONG_LONG size;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1224
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1;

/* "cuda/ccuda.pxd":1226
 * ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC;

/* "cuda/ccuda.pxd":1228
 * ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC
 * 
 * cdef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st:             # <<<<<<<<<<<<<<
 *     unsigned long long offset
 *     CUDA_ARRAY3D_DESCRIPTOR arrayDesc
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
  unsigned PY_LONG_LONG offset;
  __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR arrayDesc;
  unsigned int numLevels;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1234
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1;

/* "cuda/ccuda.pxd":1236
 * ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1
 * 
 * ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUexternalSemaphoreHandleType_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC;

/* "cuda/ccuda.pxd":1250
 *     CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10
 * 
 * ctypedef CUexternalSemaphoreHandleType_enum CUexternalSemaphoreHandleType             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUexternalSemaphoreHandleType_enum __pyx_t_4cuda_5ccuda_CUexternalSemaphoreHandleType;

/* "cuda/ccuda.pxd":1252
 * ctypedef CUexternalSemaphoreHandleType_enum CUexternalSemaphoreHandleType
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s:             # <<<<<<<<<<<<<<
 *     void* handle
 *     void* name
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s {
  void *handle;
  void *name;
};

/* "cuda/ccuda.pxd":1256
 *     void* name
 * 
 * cdef union _CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_u:             # <<<<<<<<<<<<<<
 *     int fd
 *     _CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s win32
 */
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_u {
  int fd;
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_handle_win32_s win32;
  void *nvSciSyncObj;
};

/* "cuda/ccuda.pxd":1261
 *     void* nvSciSyncObj
 * 
 * cdef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st:             # <<<<<<<<<<<<<<
 *     CUexternalSemaphoreHandleType type
 *     _CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_u handle
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
  __pyx_t_4cuda_5ccuda_CUexternalSemaphoreHandleType type;
  union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st_handle_u handle;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1267
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1;

/* "cuda/ccuda.pxd":1269
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC;

/* "cuda/ccuda.pxd":1271
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s:             # <<<<<<<<<<<<<<
 *     unsigned long long value
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s {
  unsigned PY_LONG_LONG value;
};

/* "cuda/ccuda.pxd":1274
 *     unsigned long long value
 * 
 * cdef union _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_nvSciSync_u:             # <<<<<<<<<<<<<<
 *     void* fence
 *     unsigned long long reserved
 */
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_nvSciSync_u {
  void *fence;
  unsigned PY_LONG_LONG reserved;
};

/* "cuda/ccuda.pxd":1278
 *     unsigned long long reserved
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_keyedMutex_s:             # <<<<<<<<<<<<<<
 *     unsigned long long key
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_keyedMutex_s {
  unsigned PY_LONG_LONG key;
};

/* "cuda/ccuda.pxd":1281
 *     unsigned long long key
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_s:             # <<<<<<<<<<<<<<
 *     _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s fence
 *     _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_nvSciSync_u nvSciSync
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_s {
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_fence_s fence;
  union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_nvSciSync_u nvSciSync;
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_params_keyedMutex_s keyedMutex;
  unsigned int reserved[12];
};

/* "cuda/ccuda.pxd":1287
 *     unsigned int reserved[12]
 * 
 * cdef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st:             # <<<<<<<<<<<<<<
 *     _CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_s params
 *     unsigned int flags
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st_params_s params;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1292
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1;

/* "cuda/ccuda.pxd":1294
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS;

/* "cuda/ccuda.pxd":1296
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s:             # <<<<<<<<<<<<<<
 *     unsigned long long value
 * 
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s {
  unsigned PY_LONG_LONG value;
};

/* "cuda/ccuda.pxd":1299
 *     unsigned long long value
 * 
 * cdef union _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_nvSciSync_u:             # <<<<<<<<<<<<<<
 *     void* fence
 *     unsigned long long reserved
 */
union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_nvSciSync_u {
  void *fence;
  unsigned PY_LONG_LONG reserved;
};

/* "cuda/ccuda.pxd":1303
 *     unsigned long long reserved
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_keyedMutex_s:             # <<<<<<<<<<<<<<
 *     unsigned long long key
 *     unsigned int timeoutMs
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_keyedMutex_s {
  unsigned PY_LONG_LONG key;
  unsigned int timeoutMs;
};

/* "cuda/ccuda.pxd":1307
 *     unsigned int timeoutMs
 * 
 * cdef struct _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_s:             # <<<<<<<<<<<<<<
 *     _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s fence
 *     _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_nvSciSync_u nvSciSync
 */
struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_s {
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_fence_s fence;
  union __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_nvSciSync_u nvSciSync;
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_params_keyedMutex_s keyedMutex;
  unsigned int reserved[10];
};

/* "cuda/ccuda.pxd":1313
 *     unsigned int reserved[10]
 * 
 * cdef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st:             # <<<<<<<<<<<<<<
 *     _CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_s params
 *     unsigned int flags
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
  struct __pyx_t_4cuda_5ccuda__CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st_params_s params;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccuda.pxd":1318
 *     unsigned int reserved[16]
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1;

/* "cuda/ccuda.pxd":1320
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1
 * 
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS;

/* "cuda/ccuda.pxd":1322
 * ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS
 * 
 * cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUexternalSemaphore* extSemArray
 *     const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUexternalSemaphore *extSemArray;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *paramsArray;
  unsigned int numExtSems;
};

/* "cuda/ccuda.pxd":1327
 *     unsigned int numExtSems
 * 
 * ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1;

/* "cuda/ccuda.pxd":1329
 * ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1
 * 
 * ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS;

/* "cuda/ccuda.pxd":1331
 * ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS
 * 
 * cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUexternalSemaphore* extSemArray
 *     const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray
 */
struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUexternalSemaphore *extSemArray;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *paramsArray;
  unsigned int numExtSems;
};

/* "cuda/ccuda.pxd":1336
 *     unsigned int numExtSems
 * 
 * ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1;

/* "cuda/ccuda.pxd":1338
 * ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1
 * 
 * ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned long long CUmemGenericAllocationHandle_v1
 */
typedef __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 __pyx_t_4cuda_5ccuda_CUDA_EXT_SEM_WAIT_NODE_PARAMS;

/* "cuda/ccuda.pxd":1351
 *     CU_MEM_HANDLE_TYPE_MAX = 0x7FFFFFFF
 * 
 * ctypedef CUmemAllocationHandleType_enum CUmemAllocationHandleType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAccess_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAllocationHandleType_enum __pyx_t_4cuda_5ccuda_CUmemAllocationHandleType;

/* "cuda/ccuda.pxd":1359
 *     CU_MEM_ACCESS_FLAGS_PROT_MAX = 0x7FFFFFFF
 * 
 * ctypedef CUmemAccess_flags_enum CUmemAccess_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemLocationType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAccess_flags_enum __pyx_t_4cuda_5ccuda_CUmemAccess_flags;

/* "cuda/ccuda.pxd":1366
 *     CU_MEM_LOCATION_TYPE_MAX = 0x7FFFFFFF
 * 
 * ctypedef CUmemLocationType_enum CUmemLocationType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAllocationType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemLocationType_enum __pyx_t_4cuda_5ccuda_CUmemLocationType;

/* "cuda/ccuda.pxd":1373
 *     CU_MEM_ALLOCATION_TYPE_MAX = 0x7FFFFFFF
 * 
 * ctypedef CUmemAllocationType_enum CUmemAllocationType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAllocationGranularity_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAllocationType_enum __pyx_t_4cuda_5ccuda_CUmemAllocationType;

/* "cuda/ccuda.pxd":1379
 *     CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 0x1
 * 
 * ctypedef CUmemAllocationGranularity_flags_enum CUmemAllocationGranularity_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUarraySparseSubresourceType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAllocationGranularity_flags_enum __pyx_t_4cuda_5ccuda_CUmemAllocationGranularity_flags;

/* "cuda/ccuda.pxd":1385
 *     CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1
 * 
 * ctypedef CUarraySparseSubresourceType_enum CUarraySparseSubresourceType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemOperationType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUarraySparseSubresourceType_enum __pyx_t_4cuda_5ccuda_CUarraySparseSubresourceType;

/* "cuda/ccuda.pxd":1391
 *     CU_MEM_OPERATION_TYPE_UNMAP = 2
 * 
 * ctypedef CUmemOperationType_enum CUmemOperationType             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemHandleType_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemOperationType_enum __pyx_t_4cuda_5ccuda_CUmemOperationType;

/* "cuda/ccuda.pxd":1396
 *     CU_MEM_HANDLE_TYPE_GENERIC = 0
 * 
 * ctypedef CUmemHandleType_enum CUmemHandleType             # <<<<<<<<<<<<<<
 * 
 * cdef union _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemHandleType_enum __pyx_t_4cuda_5ccuda_CUmemHandleType;

/* "cuda/ccuda.pxd":1398
 * ctypedef CUmemHandleType_enum CUmemHandleType
 * 
 * cdef union _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u:             # <<<<<<<<<<<<<<
 *     CUmipmappedArray mipmap
 *     CUarray array
 */
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u {
  __pyx_t_4cuda_5ccuda_CUmipmappedArray mipmap;
  __pyx_t_4cuda_5ccuda_CUarray array;
};

/* "cuda/ccuda.pxd":1402
 *     CUarray array
 * 
 * cdef struct _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_sparseLevel_s:             # <<<<<<<<<<<<<<
 *     unsigned int level
 *     unsigned int layer
 */
struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_sparseLevel_s {
  unsigned int level;
  unsigned int layer;
  unsigned int offsetX;
  unsigned int offsetY;
  unsigned int offsetZ;
  unsigned int extentWidth;
  unsigned int extentHeight;
  unsigned int extentDepth;
};

/* "cuda/ccuda.pxd":1412
 *     unsigned int extentDepth
 * 
 * cdef struct _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s:             # <<<<<<<<<<<<<<
 *     unsigned int layer
 *     unsigned long long offset
 */
struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s {
  unsigned int layer;
  unsigned PY_LONG_LONG offset;
  unsigned PY_LONG_LONG size;
};

/* "cuda/ccuda.pxd":1417
 *     unsigned long long size
 * 
 * cdef union _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_u:             # <<<<<<<<<<<<<<
 *     _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_sparseLevel_s sparseLevel
 *     _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s miptail
 */
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_u {
  struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_sparseLevel_s sparseLevel;
  struct __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s miptail;
};

/* "cuda/ccuda.pxd":1421
 *     _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_subresource_miptail_s miptail
 * 
 * cdef union _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_memHandle_u:             # <<<<<<<<<<<<<<
 *     CUmemGenericAllocationHandle memHandle
 * 
 */
union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_memHandle_u {
  __pyx_t_4cuda_5ccuda_CUmemGenericAllocationHandle memHandle;
};

/* "cuda/ccuda.pxd":1424
 *     CUmemGenericAllocationHandle memHandle
 * 
 * cdef struct CUarrayMapInfo_st:             # <<<<<<<<<<<<<<
 *     CUresourcetype resourceType
 *     _CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u resource
 */
struct __pyx_t_4cuda_5ccuda_CUarrayMapInfo_st {
  __pyx_t_4cuda_5ccuda_CUresourcetype resourceType;
  union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_resource_u resource;
  __pyx_t_4cuda_5ccuda_CUarraySparseSubresourceType subresourceType;
  union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_subresource_u subresource;
  __pyx_t_4cuda_5ccuda_CUmemOperationType memOperationType;
  __pyx_t_4cuda_5ccuda_CUmemHandleType memHandleType;
  union __pyx_t_4cuda_5ccuda__CUarrayMapInfo_v1_CUarrayMapInfo_v1_CUarrayMapInfo_st_memHandle_u memHandle;
  unsigned PY_LONG_LONG offset;
  unsigned int deviceBitMask;
  unsigned int flags;
  unsigned int reserved[2];
};

/* "cuda/ccuda.pxd":1437
 *     unsigned int reserved[2]
 * 
 * ctypedef CUarrayMapInfo_st CUarrayMapInfo_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUarrayMapInfo_v1 CUarrayMapInfo
 */
typedef struct __pyx_t_4cuda_5ccuda_CUarrayMapInfo_st __pyx_t_4cuda_5ccuda_CUarrayMapInfo_v1;

/* "cuda/ccuda.pxd":1439
 * ctypedef CUarrayMapInfo_st CUarrayMapInfo_v1
 * 
 * ctypedef CUarrayMapInfo_v1 CUarrayMapInfo             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUmemLocation_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUarrayMapInfo_v1 __pyx_t_4cuda_5ccuda_CUarrayMapInfo;

/* "cuda/ccuda.pxd":1441
 * ctypedef CUarrayMapInfo_v1 CUarrayMapInfo
 * 
 * cdef struct CUmemLocation_st:             # <<<<<<<<<<<<<<
 *     CUmemLocationType type
 *     int id
 */
struct __pyx_t_4cuda_5ccuda_CUmemLocation_st {
  __pyx_t_4cuda_5ccuda_CUmemLocationType type;
  int id;
};

/* "cuda/ccuda.pxd":1445
 *     int id
 * 
 * ctypedef CUmemLocation_st CUmemLocation_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemLocation_v1 CUmemLocation
 */
typedef struct __pyx_t_4cuda_5ccuda_CUmemLocation_st __pyx_t_4cuda_5ccuda_CUmemLocation_v1;

/* "cuda/ccuda.pxd":1447
 * ctypedef CUmemLocation_st CUmemLocation_v1
 * 
 * ctypedef CUmemLocation_v1 CUmemLocation             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemAllocationCompType_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemLocation_v1 __pyx_t_4cuda_5ccuda_CUmemLocation;

/* "cuda/ccuda.pxd":1453
 *     CU_MEM_ALLOCATION_COMP_GENERIC = 0x1
 * 
 * ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemAllocationCompType_enum __pyx_t_4cuda_5ccuda_CUmemAllocationCompType;

/* "cuda/ccuda.pxd":1455
 * ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType
 * 
 * cdef struct _CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s:             # <<<<<<<<<<<<<<
 *     unsigned char compressionType
 *     unsigned char gpuDirectRDMACapable
 */
struct __pyx_t_4cuda_5ccuda__CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s {
  unsigned char compressionType;
  unsigned char gpuDirectRDMACapable;
  unsigned short usage;
  unsigned char reserved[4];
};

/* "cuda/ccuda.pxd":1461
 *     unsigned char reserved[4]
 * 
 * cdef struct CUmemAllocationProp_st:             # <<<<<<<<<<<<<<
 *     CUmemAllocationType type
 *     CUmemAllocationHandleType requestedHandleTypes
 */
struct __pyx_t_4cuda_5ccuda_CUmemAllocationProp_st {
  __pyx_t_4cuda_5ccuda_CUmemAllocationType type;
  __pyx_t_4cuda_5ccuda_CUmemAllocationHandleType requestedHandleTypes;
  __pyx_t_4cuda_5ccuda_CUmemLocation location;
  void *win32HandleMetaData;
  struct __pyx_t_4cuda_5ccuda__CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s allocFlags;
};

/* "cuda/ccuda.pxd":1468
 *     _CUmemAllocationProp_v1_CUmemAllocationProp_v1_CUmemAllocationProp_st_allocFlags_s allocFlags
 * 
 * ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemAllocationProp_v1 CUmemAllocationProp
 */
typedef struct __pyx_t_4cuda_5ccuda_CUmemAllocationProp_st __pyx_t_4cuda_5ccuda_CUmemAllocationProp_v1;

/* "cuda/ccuda.pxd":1470
 * ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1
 * 
 * ctypedef CUmemAllocationProp_v1 CUmemAllocationProp             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUmemAccessDesc_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemAllocationProp_v1 __pyx_t_4cuda_5ccuda_CUmemAllocationProp;

/* "cuda/ccuda.pxd":1472
 * ctypedef CUmemAllocationProp_v1 CUmemAllocationProp
 * 
 * cdef struct CUmemAccessDesc_st:             # <<<<<<<<<<<<<<
 *     CUmemLocation location
 *     CUmemAccess_flags flags
 */
struct __pyx_t_4cuda_5ccuda_CUmemAccessDesc_st {
  __pyx_t_4cuda_5ccuda_CUmemLocation location;
  __pyx_t_4cuda_5ccuda_CUmemAccess_flags flags;
};

/* "cuda/ccuda.pxd":1476
 *     CUmemAccess_flags flags
 * 
 * ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemAccessDesc_v1 CUmemAccessDesc
 */
typedef struct __pyx_t_4cuda_5ccuda_CUmemAccessDesc_st __pyx_t_4cuda_5ccuda_CUmemAccessDesc_v1;

/* "cuda/ccuda.pxd":1478
 * ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1
 * 
 * ctypedef CUmemAccessDesc_v1 CUmemAccessDesc             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphExecUpdateResult_enum:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemAccessDesc_v1 __pyx_t_4cuda_5ccuda_CUmemAccessDesc;

/* "cuda/ccuda.pxd":1490
 *     CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 0x7
 * 
 * ctypedef CUgraphExecUpdateResult_enum CUgraphExecUpdateResult             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUmemPool_attribute_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphExecUpdateResult_enum __pyx_t_4cuda_5ccuda_CUgraphExecUpdateResult;

/* "cuda/ccuda.pxd":1502
 *     CU_MEMPOOL_ATTR_USED_MEM_HIGH
 * 
 * ctypedef CUmemPool_attribute_enum CUmemPool_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUmemPoolProps_st:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUmemPool_attribute_enum __pyx_t_4cuda_5ccuda_CUmemPool_attribute;

/* "cuda/ccuda.pxd":1504
 * ctypedef CUmemPool_attribute_enum CUmemPool_attribute
 * 
 * cdef struct CUmemPoolProps_st:             # <<<<<<<<<<<<<<
 *     CUmemAllocationType allocType
 *     CUmemAllocationHandleType handleTypes
 */
struct __pyx_t_4cuda_5ccuda_CUmemPoolProps_st {
  __pyx_t_4cuda_5ccuda_CUmemAllocationType allocType;
  __pyx_t_4cuda_5ccuda_CUmemAllocationHandleType handleTypes;
  __pyx_t_4cuda_5ccuda_CUmemLocation location;
  void *win32SecurityAttributes;
  unsigned char reserved[64];
};

/* "cuda/ccuda.pxd":1511
 *     unsigned char reserved[64]
 * 
 * ctypedef CUmemPoolProps_st CUmemPoolProps_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemPoolProps_v1 CUmemPoolProps
 */
typedef struct __pyx_t_4cuda_5ccuda_CUmemPoolProps_st __pyx_t_4cuda_5ccuda_CUmemPoolProps_v1;

/* "cuda/ccuda.pxd":1513
 * ctypedef CUmemPoolProps_st CUmemPoolProps_v1
 * 
 * ctypedef CUmemPoolProps_v1 CUmemPoolProps             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUmemPoolPtrExportData_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemPoolProps_v1 __pyx_t_4cuda_5ccuda_CUmemPoolProps;

/* "cuda/ccuda.pxd":1515
 * ctypedef CUmemPoolProps_v1 CUmemPoolProps
 * 
 * cdef struct CUmemPoolPtrExportData_st:             # <<<<<<<<<<<<<<
 *     unsigned char reserved[64]
 * 
 */
struct __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData_st {
  unsigned char reserved[64];
};

/* "cuda/ccuda.pxd":1518
 *     unsigned char reserved[64]
 * 
 * ctypedef CUmemPoolPtrExportData_st CUmemPoolPtrExportData_v1             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData
 */
typedef struct __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData_st __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData_v1;

/* "cuda/ccuda.pxd":1520
 * ctypedef CUmemPoolPtrExportData_st CUmemPoolPtrExportData_v1
 * 
 * ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData             # <<<<<<<<<<<<<<
 * 
 * cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_st:
 */
typedef __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData_v1 __pyx_t_4cuda_5ccuda_CUmemPoolPtrExportData;

/* "cuda/ccuda.pxd":1522
 * ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData
 * 
 * cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_st:             # <<<<<<<<<<<<<<
 *     CUmemPoolProps poolProps
 *     const CUmemAccessDesc* accessDescs
 */
struct __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS_st {
  __pyx_t_4cuda_5ccuda_CUmemPoolProps poolProps;
  __pyx_t_4cuda_5ccuda_CUmemAccessDesc const *accessDescs;
  size_t accessDescCount;
  size_t bytesize;
  __pyx_t_4cuda_5ccuda_CUdeviceptr dptr;
};

/* "cuda/ccuda.pxd":1529
 *     CUdeviceptr dptr
 * 
 * ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_st CUDA_MEM_ALLOC_NODE_PARAMS             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphMem_attribute_enum:
 */
typedef struct __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS_st __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS;

/* "cuda/ccuda.pxd":1537
 *     CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH
 * 
 * ctypedef CUgraphMem_attribute_enum CUgraphMem_attribute             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUflushGPUDirectRDMAWritesOptions_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphMem_attribute_enum __pyx_t_4cuda_5ccuda_CUgraphMem_attribute;

/* "cuda/ccuda.pxd":1543
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 1<<1
 * 
 * ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUGPUDirectRDMAWritesOrdering_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesOptions_enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesOptions;

/* "cuda/ccuda.pxd":1550
 *     CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = 200
 * 
 * ctypedef CUGPUDirectRDMAWritesOrdering_enum CUGPUDirectRDMAWritesOrdering             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUflushGPUDirectRDMAWritesScope_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUGPUDirectRDMAWritesOrdering_enum __pyx_t_4cuda_5ccuda_CUGPUDirectRDMAWritesOrdering;

/* "cuda/ccuda.pxd":1556
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 200
 * 
 * ctypedef CUflushGPUDirectRDMAWritesScope_enum CUflushGPUDirectRDMAWritesScope             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUflushGPUDirectRDMAWritesTarget_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesScope_enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesScope;

/* "cuda/ccuda.pxd":1561
 *     CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0
 * 
 * ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphDebugDot_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesTarget_enum __pyx_t_4cuda_5ccuda_CUflushGPUDirectRDMAWritesTarget;

/* "cuda/ccuda.pxd":1578
 *     CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = 1<<12
 * 
 * ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUuserObject_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphDebugDot_flags_enum __pyx_t_4cuda_5ccuda_CUgraphDebugDot_flags;

/* "cuda/ccuda.pxd":1583
 *     CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1
 * 
 * ctypedef CUuserObject_flags_enum CUuserObject_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUuserObjectRetain_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUuserObject_flags_enum __pyx_t_4cuda_5ccuda_CUuserObject_flags;

/* "cuda/ccuda.pxd":1588
 *     CU_GRAPH_USER_OBJECT_MOVE = 1
 * 
 * ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUgraphInstantiate_flags_enum:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUuserObjectRetain_flags_enum __pyx_t_4cuda_5ccuda_CUuserObjectRetain_flags;

/* "cuda/ccuda.pxd":1593
 *     CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1
 * 
 * ctypedef CUgraphInstantiate_flags_enum CUgraphInstantiate_flags             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuGetErrorString(CUresult error, const char** pStr) nogil except ?CUDA_ERROR_NOT_FOUND
 */
typedef enum __pyx_t_4cuda_5ccuda_CUgraphInstantiate_flags_enum __pyx_t_4cuda_5ccuda_CUgraphInstantiate_flags;
struct __pyx_t_4cuda_7ccudart_dim3;
struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc;
struct __pyx_t_4cuda_7ccudart__cudaArraySparseProperties_tileExtent_s;
struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties;
struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr;
struct __pyx_t_4cuda_7ccudart_cudaExtent;
struct __pyx_t_4cuda_7ccudart_cudaPos;
struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms;
struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms;
struct __pyx_t_4cuda_7ccudart_cudaMemsetParams;
struct __pyx_t_4cuda_7ccudart_cudaAccessPolicyWindow;
struct __pyx_t_4cuda_7ccudart_cudaHostNodeParams;
union __pyx_t_4cuda_7ccudart_cudaStreamAttrValue;
union __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue;
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_array_s;
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_mipmap_s;
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_linear_s;
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_pitch2D_s;
union __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_u;
struct __pyx_t_4cuda_7ccudart_cudaResourceDesc;
struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc;
struct __pyx_t_4cuda_7ccudart_cudaPointerAttributes;
struct __pyx_t_4cuda_7ccudart_cudaFuncAttributes;
struct __pyx_t_4cuda_7ccudart_cudaMemLocation;
struct __pyx_t_4cuda_7ccudart_cudaMemAccessDesc;
struct __pyx_t_4cuda_7ccudart_cudaMemPoolProps;
struct __pyx_t_4cuda_7ccudart_cudaMemPoolPtrExportData;
struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams;
struct __pyx_t_4cuda_7ccudart_CUuuid_st;
struct __pyx_t_4cuda_7ccudart_cudaDeviceProp;
struct __pyx_t_4cuda_7ccudart_cudaIpcEventHandle_st;
struct __pyx_t_4cuda_7ccudart_cudaIpcMemHandle_st;
struct __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_handle_win32_s;
union __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_u;
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleDesc;
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryBufferDesc;
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryMipmappedArrayDesc;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_handle_win32_s;
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_u;
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleDesc;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_fence_s;
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_nvSciSync_u;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_keyedMutex_s;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_s;
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalParams;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_fence_s;
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_nvSciSync_u;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_keyedMutex_s;
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_s;
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitParams;
struct __pyx_t_4cuda_7ccudart_cudaKernelNodeParams;
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalNodeParams;
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitNodeParams;
struct __pyx_t_4cuda_7ccudart_cudaTextureDesc;

/* "cuda/ccudart.pxd":9
 * # is strictly prohibited.
 * 
 * cdef enum cudaRoundMode:             # <<<<<<<<<<<<<<
 *     cudaRoundNearest
 *     cudaRoundZero
 */
enum __pyx_t_4cuda_7ccudart_cudaRoundMode {
  __pyx_e_4cuda_7ccudart_cudaRoundNearest,
  __pyx_e_4cuda_7ccudart_cudaRoundZero,
  __pyx_e_4cuda_7ccudart_cudaRoundPosInf,
  __pyx_e_4cuda_7ccudart_cudaRoundMinInf
};

/* "cuda/ccudart.pxd":20
 *     unsigned int z
 * 
 * cdef enum cudaError:             # <<<<<<<<<<<<<<
 *     cudaSuccess = 0
 *     cudaErrorInvalidValue = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaError {
  __pyx_e_4cuda_7ccudart_cudaSuccess = 0,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue = 1,
  __pyx_e_4cuda_7ccudart_cudaErrorMemoryAllocation = 2,
  __pyx_e_4cuda_7ccudart_cudaErrorInitializationError = 3,
  __pyx_e_4cuda_7ccudart_cudaErrorCudartUnloading = 4,
  __pyx_e_4cuda_7ccudart_cudaErrorProfilerDisabled = 5,
  __pyx_e_4cuda_7ccudart_cudaErrorProfilerNotInitialized = 6,
  __pyx_e_4cuda_7ccudart_cudaErrorProfilerAlreadyStarted = 7,
  __pyx_e_4cuda_7ccudart_cudaErrorProfilerAlreadyStopped = 8,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidConfiguration = 9,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidPitchValue = 12,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidSymbol = 13,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidHostPointer = 16,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevicePointer = 17,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidTexture = 18,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidTextureBinding = 19,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidChannelDescriptor = 20,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidMemcpyDirection = 21,
  __pyx_e_4cuda_7ccudart_cudaErrorAddressOfConstant = 22,
  __pyx_e_4cuda_7ccudart_cudaErrorTextureFetchFailed = 23,
  __pyx_e_4cuda_7ccudart_cudaErrorTextureNotBound = 24,
  __pyx_e_4cuda_7ccudart_cudaErrorSynchronizationError = 25,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidFilterSetting = 26,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidNormSetting = 27,
  __pyx_e_4cuda_7ccudart_cudaErrorMixedDeviceExecution = 28,
  __pyx_e_4cuda_7ccudart_cudaErrorNotYetImplemented = 31,
  __pyx_e_4cuda_7ccudart_cudaErrorMemoryValueTooLarge = 32,
  __pyx_e_4cuda_7ccudart_cudaErrorStubLibrary = 34,
  __pyx_e_4cuda_7ccudart_cudaErrorInsufficientDriver = 35,
  __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver = 36,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidSurface = 37,
  __pyx_e_4cuda_7ccudart_cudaErrorDuplicateVariableName = 43,
  __pyx_e_4cuda_7ccudart_cudaErrorDuplicateTextureName = 44,
  __pyx_e_4cuda_7ccudart_cudaErrorDuplicateSurfaceName = 45,
  __pyx_e_4cuda_7ccudart_cudaErrorDevicesUnavailable = 46,
  __pyx_e_4cuda_7ccudart_cudaErrorIncompatibleDriverContext = 49,
  __pyx_e_4cuda_7ccudart_cudaErrorMissingConfiguration = 52,
  __pyx_e_4cuda_7ccudart_cudaErrorPriorLaunchFailure = 53,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchMaxDepthExceeded = 65,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchFileScopedTex = 66,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchFileScopedSurf = 67,
  __pyx_e_4cuda_7ccudart_cudaErrorSyncDepthExceeded = 68,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchPendingCountExceeded = 69,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidDeviceFunction = 98,
  __pyx_e_4cuda_7ccudart_cudaErrorNoDevice = 0x64,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice = 0x65,
  __pyx_e_4cuda_7ccudart_cudaErrorDeviceNotLicensed = 0x66,
  __pyx_e_4cuda_7ccudart_cudaErrorSoftwareValidityNotEstablished = 0x67,
  __pyx_e_4cuda_7ccudart_cudaErrorStartupFailure = 0x7F,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidKernelImage = 0xC8,
  __pyx_e_4cuda_7ccudart_cudaErrorDeviceUninitialized = 0xC9,
  __pyx_e_4cuda_7ccudart_cudaErrorMapBufferObjectFailed = 0xCD,
  __pyx_e_4cuda_7ccudart_cudaErrorUnmapBufferObjectFailed = 0xCE,
  __pyx_e_4cuda_7ccudart_cudaErrorArrayIsMapped = 0xCF,
  __pyx_e_4cuda_7ccudart_cudaErrorAlreadyMapped = 0xD0,
  __pyx_e_4cuda_7ccudart_cudaErrorNoKernelImageForDevice = 0xD1,
  __pyx_e_4cuda_7ccudart_cudaErrorAlreadyAcquired = 0xD2,
  __pyx_e_4cuda_7ccudart_cudaErrorNotMapped = 0xD3,
  __pyx_e_4cuda_7ccudart_cudaErrorNotMappedAsArray = 0xD4,
  __pyx_e_4cuda_7ccudart_cudaErrorNotMappedAsPointer = 0xD5,
  __pyx_e_4cuda_7ccudart_cudaErrorECCUncorrectable = 0xD6,
  __pyx_e_4cuda_7ccudart_cudaErrorUnsupportedLimit = 0xD7,
  __pyx_e_4cuda_7ccudart_cudaErrorDeviceAlreadyInUse = 0xD8,
  __pyx_e_4cuda_7ccudart_cudaErrorPeerAccessUnsupported = 0xD9,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidPtx = 0xDA,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidGraphicsContext = 0xDB,
  __pyx_e_4cuda_7ccudart_cudaErrorNvlinkUncorrectable = 0xDC,
  __pyx_e_4cuda_7ccudart_cudaErrorJitCompilerNotFound = 0xDD,
  __pyx_e_4cuda_7ccudart_cudaErrorUnsupportedPtxVersion = 0xDE,
  __pyx_e_4cuda_7ccudart_cudaErrorJitCompilationDisabled = 0xDF,
  __pyx_e_4cuda_7ccudart_cudaErrorUnsupportedExecAffinity = 0xE0,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidSource = 0x12C,
  __pyx_e_4cuda_7ccudart_cudaErrorFileNotFound = 0x12D,
  __pyx_e_4cuda_7ccudart_cudaErrorSharedObjectSymbolNotFound = 0x12E,
  __pyx_e_4cuda_7ccudart_cudaErrorSharedObjectInitFailed = 0x12F,
  __pyx_e_4cuda_7ccudart_cudaErrorOperatingSystem = 0x130,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidResourceHandle = 0x190,
  __pyx_e_4cuda_7ccudart_cudaErrorIllegalState = 0x191,
  __pyx_e_4cuda_7ccudart_cudaErrorSymbolNotFound = 0x1F4,
  __pyx_e_4cuda_7ccudart_cudaErrorNotReady = 0x258,
  __pyx_e_4cuda_7ccudart_cudaErrorIllegalAddress = 0x2BC,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchOutOfResources = 0x2BD,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchTimeout = 0x2BE,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchIncompatibleTexturing = 0x2BF,
  __pyx_e_4cuda_7ccudart_cudaErrorPeerAccessAlreadyEnabled = 0x2C0,
  __pyx_e_4cuda_7ccudart_cudaErrorPeerAccessNotEnabled = 0x2C1,
  __pyx_e_4cuda_7ccudart_cudaErrorSetOnActiveProcess = 0x2C4,
  __pyx_e_4cuda_7ccudart_cudaErrorContextIsDestroyed = 0x2C5,
  __pyx_e_4cuda_7ccudart_cudaErrorAssert = 0x2C6,
  __pyx_e_4cuda_7ccudart_cudaErrorTooManyPeers = 0x2C7,
  __pyx_e_4cuda_7ccudart_cudaErrorHostMemoryAlreadyRegistered = 0x2C8,
  __pyx_e_4cuda_7ccudart_cudaErrorHostMemoryNotRegistered = 0x2C9,
  __pyx_e_4cuda_7ccudart_cudaErrorHardwareStackError = 0x2CA,
  __pyx_e_4cuda_7ccudart_cudaErrorIllegalInstruction = 0x2CB,
  __pyx_e_4cuda_7ccudart_cudaErrorMisalignedAddress = 0x2CC,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidAddressSpace = 0x2CD,
  __pyx_e_4cuda_7ccudart_cudaErrorInvalidPc = 0x2CE,
  __pyx_e_4cuda_7ccudart_cudaErrorLaunchFailure = 0x2CF,
  __pyx_e_4cuda_7ccudart_cudaErrorCooperativeLaunchTooLarge = 0x2D0,
  __pyx_e_4cuda_7ccudart_cudaErrorNotPermitted = 0x320,
  __pyx_e_4cuda_7ccudart_cudaErrorNotSupported = 0x321,
  __pyx_e_4cuda_7ccudart_cudaErrorSystemNotReady = 0x322,
  __pyx_e_4cuda_7ccudart_cudaErrorSystemDriverMismatch = 0x323,
  __pyx_e_4cuda_7ccudart_cudaErrorCompatNotSupportedOnDevice = 0x324,
  __pyx_e_4cuda_7ccudart_cudaErrorMpsConnectionFailed = 0x325,
  __pyx_e_4cuda_7ccudart_cudaErrorMpsRpcFailure = 0x326,
  __pyx_e_4cuda_7ccudart_cudaErrorMpsServerNotReady = 0x327,
  __pyx_e_4cuda_7ccudart_cudaErrorMpsMaxClientsReached = 0x328,
  __pyx_e_4cuda_7ccudart_cudaErrorMpsMaxConnectionsReached = 0x329,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureUnsupported = 0x384,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureInvalidated = 0x385,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureMerge = 0x386,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureUnmatched = 0x387,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureUnjoined = 0x388,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureIsolation = 0x389,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureImplicit = 0x38A,
  __pyx_e_4cuda_7ccudart_cudaErrorCapturedEvent = 0x38B,
  __pyx_e_4cuda_7ccudart_cudaErrorStreamCaptureWrongThread = 0x38C,
  __pyx_e_4cuda_7ccudart_cudaErrorTimeout = 0x38D,
  __pyx_e_4cuda_7ccudart_cudaErrorGraphExecUpdateFailure = 0x38E,
  __pyx_e_4cuda_7ccudart_cudaErrorExternalDevice = 0x38F,
  __pyx_e_4cuda_7ccudart_cudaErrorUnknown = 0x3E7,
  __pyx_e_4cuda_7ccudart_cudaErrorApiFailureBase = 0x2710
};

/* "cuda/ccudart.pxd":145
 *     cudaErrorApiFailureBase = 10000
 * 
 * cdef enum cudaChannelFormatKind:             # <<<<<<<<<<<<<<
 *     cudaChannelFormatKindSigned = 0
 *     cudaChannelFormatKindUnsigned = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaChannelFormatKind {
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSigned = 0,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsigned = 1,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindFloat = 2,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindNone = 3,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindNV12 = 4,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized8X1 = 5,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized8X2 = 6,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized8X4 = 7,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized16X1 = 8,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized16X2 = 9,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedNormalized16X4 = 10,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized8X1 = 11,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized8X2 = 12,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized8X4 = 13,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized16X1 = 14,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized16X2 = 15,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedNormalized16X4 = 16,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed1 = 17,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed2 = 19,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed3 = 21,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed4 = 23,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedBlockCompressed4 = 24,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed5 = 25,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedBlockCompressed5 = 26,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed6H = 27,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSignedBlockCompressed6H = 28,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed7 = 29,
  __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30
};

/* "cuda/ccudart.pxd":219
 *     unsigned int reserved[4]
 * 
 * cdef enum cudaMemoryType:             # <<<<<<<<<<<<<<
 *     cudaMemoryTypeUnregistered = 0
 *     cudaMemoryTypeHost = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemoryType {
  __pyx_e_4cuda_7ccudart_cudaMemoryTypeUnregistered = 0,
  __pyx_e_4cuda_7ccudart_cudaMemoryTypeHost = 1,
  __pyx_e_4cuda_7ccudart_cudaMemoryTypeDevice = 2,
  __pyx_e_4cuda_7ccudart_cudaMemoryTypeManaged = 3
};

/* "cuda/ccudart.pxd":225
 *     cudaMemoryTypeManaged = 3
 * 
 * cdef enum cudaMemcpyKind:             # <<<<<<<<<<<<<<
 *     cudaMemcpyHostToHost = 0
 *     cudaMemcpyHostToDevice = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind {
  __pyx_e_4cuda_7ccudart_cudaMemcpyHostToHost = 0,
  __pyx_e_4cuda_7ccudart_cudaMemcpyHostToDevice = 1,
  __pyx_e_4cuda_7ccudart_cudaMemcpyDeviceToHost = 2,
  __pyx_e_4cuda_7ccudart_cudaMemcpyDeviceToDevice = 3,
  __pyx_e_4cuda_7ccudart_cudaMemcpyDefault = 4
};

/* "cuda/ccudart.pxd":277
 *     size_t height
 * 
 * cdef enum cudaAccessProperty:             # <<<<<<<<<<<<<<
 *     cudaAccessPropertyNormal = 0
 *     cudaAccessPropertyStreaming = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaAccessProperty {
  __pyx_e_4cuda_7ccudart_cudaAccessPropertyNormal = 0,
  __pyx_e_4cuda_7ccudart_cudaAccessPropertyStreaming = 1,
  __pyx_e_4cuda_7ccudart_cudaAccessPropertyPersisting = 2
};

/* "cuda/ccudart.pxd":295
 *     void* userData
 * 
 * cdef enum cudaStreamCaptureStatus:             # <<<<<<<<<<<<<<
 *     cudaStreamCaptureStatusNone = 0
 *     cudaStreamCaptureStatusActive = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureStatus {
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureStatusNone = 0,
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureStatusActive = 1,
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureStatusInvalidated = 2
};

/* "cuda/ccudart.pxd":300
 *     cudaStreamCaptureStatusInvalidated = 2
 * 
 * cdef enum cudaStreamCaptureMode:             # <<<<<<<<<<<<<<
 *     cudaStreamCaptureModeGlobal = 0
 *     cudaStreamCaptureModeThreadLocal = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureMode {
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureModeGlobal = 0,
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureModeThreadLocal = 1,
  __pyx_e_4cuda_7ccudart_cudaStreamCaptureModeRelaxed = 2
};

/* "cuda/ccudart.pxd":305
 *     cudaStreamCaptureModeRelaxed = 2
 * 
 * cdef enum cudaSynchronizationPolicy:             # <<<<<<<<<<<<<<
 *     cudaSyncPolicyAuto = 1
 *     cudaSyncPolicySpin = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaSynchronizationPolicy {
  __pyx_e_4cuda_7ccudart_cudaSyncPolicyAuto = 1,
  __pyx_e_4cuda_7ccudart_cudaSyncPolicySpin = 2,
  __pyx_e_4cuda_7ccudart_cudaSyncPolicyYield = 3,
  __pyx_e_4cuda_7ccudart_cudaSyncPolicyBlockingSync = 4
};

/* "cuda/ccudart.pxd":311
 *     cudaSyncPolicyBlockingSync = 4
 * 
 * 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":319
 *     cudaSynchronizationPolicy syncPolicy
 * 
 * cdef enum cudaStreamUpdateCaptureDependenciesFlags:             # <<<<<<<<<<<<<<
 *     cudaStreamAddCaptureDependencies = 0x0
 *     cudaStreamSetCaptureDependencies = 0x1
 */
enum __pyx_t_4cuda_7ccudart_cudaStreamUpdateCaptureDependenciesFlags {
  __pyx_e_4cuda_7ccudart_cudaStreamAddCaptureDependencies = 0x0,
  __pyx_e_4cuda_7ccudart_cudaStreamSetCaptureDependencies = 0x1
};

/* "cuda/ccudart.pxd":323
 *     cudaStreamSetCaptureDependencies = 0x1
 * 
 * cdef enum cudaUserObjectFlags:             # <<<<<<<<<<<<<<
 *     cudaUserObjectNoDestructorSync = 0x1
 * 
 */
enum __pyx_t_4cuda_7ccudart_cudaUserObjectFlags {
  __pyx_e_4cuda_7ccudart_cudaUserObjectNoDestructorSync = 0x1
};

/* "cuda/ccudart.pxd":326
 *     cudaUserObjectNoDestructorSync = 0x1
 * 
 * cdef enum cudaUserObjectRetainFlags:             # <<<<<<<<<<<<<<
 *     cudaGraphUserObjectMove = 0x1
 * 
 */
enum __pyx_t_4cuda_7ccudart_cudaUserObjectRetainFlags {
  __pyx_e_4cuda_7ccudart_cudaGraphUserObjectMove = 0x1
};

/* "cuda/ccudart.pxd":330
 * 
 * 
 * cdef enum cudaGraphicsRegisterFlags:             # <<<<<<<<<<<<<<
 *     cudaGraphicsRegisterFlagsNone = 0
 *     cudaGraphicsRegisterFlagsReadOnly = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphicsRegisterFlags {
  __pyx_e_4cuda_7ccudart_cudaGraphicsRegisterFlagsNone = 0,
  __pyx_e_4cuda_7ccudart_cudaGraphicsRegisterFlagsReadOnly = 1,
  __pyx_e_4cuda_7ccudart_cudaGraphicsRegisterFlagsWriteDiscard = 2,
  __pyx_e_4cuda_7ccudart_cudaGraphicsRegisterFlagsSurfaceLoadStore = 4,
  __pyx_e_4cuda_7ccudart_cudaGraphicsRegisterFlagsTextureGather = 8
};

/* "cuda/ccudart.pxd":337
 *     cudaGraphicsRegisterFlagsTextureGather = 8
 * 
 * cdef enum cudaGraphicsMapFlags:             # <<<<<<<<<<<<<<
 *     cudaGraphicsMapFlagsNone = 0
 *     cudaGraphicsMapFlagsReadOnly = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphicsMapFlags {
  __pyx_e_4cuda_7ccudart_cudaGraphicsMapFlagsNone = 0,
  __pyx_e_4cuda_7ccudart_cudaGraphicsMapFlagsReadOnly = 1,
  __pyx_e_4cuda_7ccudart_cudaGraphicsMapFlagsWriteDiscard = 2
};

/* "cuda/ccudart.pxd":342
 *     cudaGraphicsMapFlagsWriteDiscard = 2
 * 
 * cdef enum cudaGraphicsCubeFace:             # <<<<<<<<<<<<<<
 *     cudaGraphicsCubeFacePositiveX = 0x00
 *     cudaGraphicsCubeFaceNegativeX = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphicsCubeFace {
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFacePositiveX = 0x00,
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFaceNegativeX = 0x01,
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFacePositiveY = 0x02,
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFaceNegativeY = 0x03,
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFacePositiveZ = 0x04,
  __pyx_e_4cuda_7ccudart_cudaGraphicsCubeFaceNegativeZ = 0x05
};

/* "cuda/ccudart.pxd":350
 *     cudaGraphicsCubeFaceNegativeZ = 0x05
 * 
 * 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
};

/* "cuda/ccudart.pxd":358
 *     int cooperative
 * 
 * cdef enum cudaResourceType:             # <<<<<<<<<<<<<<
 *     cudaResourceTypeArray = 0x00
 *     cudaResourceTypeMipmappedArray = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaResourceType {
  __pyx_e_4cuda_7ccudart_cudaResourceTypeArray = 0x00,
  __pyx_e_4cuda_7ccudart_cudaResourceTypeMipmappedArray = 0x01,
  __pyx_e_4cuda_7ccudart_cudaResourceTypeLinear = 0x02,
  __pyx_e_4cuda_7ccudart_cudaResourceTypePitch2D = 0x03
};

/* "cuda/ccudart.pxd":364
 *     cudaResourceTypePitch2D = 0x03
 * 
 * cdef enum cudaResourceViewFormat:             # <<<<<<<<<<<<<<
 *     cudaResViewFormatNone = 0x00
 *     cudaResViewFormatUnsignedChar1 = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaResourceViewFormat {
  __pyx_e_4cuda_7ccudart_cudaResViewFormatNone = 0x00,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedChar1 = 0x01,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedChar2 = 0x02,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedChar4 = 0x03,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedChar1 = 0x04,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedChar2 = 0x05,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedChar4 = 0x06,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedShort1 = 0x07,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedShort2 = 0x08,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedShort4 = 0x09,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedShort1 = 0x0a,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedShort2 = 0x0b,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedShort4 = 0x0c,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedInt1 = 0x0d,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedInt2 = 0x0e,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedInt4 = 0x0f,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedInt1 = 0x10,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedInt2 = 0x11,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedInt4 = 0x12,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatHalf1 = 0x13,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatHalf2 = 0x14,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatHalf4 = 0x15,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatFloat1 = 0x16,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatFloat2 = 0x17,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatFloat4 = 0x18,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed1 = 0x19,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed2 = 0x1a,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed3 = 0x1b,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed4 = 0x1c,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedBlockCompressed4 = 0x1d,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed5 = 0x1e,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedBlockCompressed5 = 0x1f,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed6H = 0x20,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatSignedBlockCompressed6H = 0x21,
  __pyx_e_4cuda_7ccudart_cudaResViewFormatUnsignedBlockCompressed7 = 0x22
};

/* "cuda/ccudart.pxd":457
 *     int preferredShmemCarveout
 * 
 * cdef enum cudaFuncAttribute:             # <<<<<<<<<<<<<<
 *     cudaFuncAttributeMaxDynamicSharedMemorySize = 8
 *     cudaFuncAttributePreferredSharedMemoryCarveout = 9
 */
enum __pyx_t_4cuda_7ccudart_cudaFuncAttribute {
  __pyx_e_4cuda_7ccudart_cudaFuncAttributeMaxDynamicSharedMemorySize = 8,
  __pyx_e_4cuda_7ccudart_cudaFuncAttributePreferredSharedMemoryCarveout = 9,
  __pyx_e_4cuda_7ccudart_cudaFuncAttributeMax
};

/* "cuda/ccudart.pxd":462
 *     cudaFuncAttributeMax
 * 
 * cdef enum cudaFuncCache:             # <<<<<<<<<<<<<<
 *     cudaFuncCachePreferNone = 0
 *     cudaFuncCachePreferShared = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaFuncCache {
  __pyx_e_4cuda_7ccudart_cudaFuncCachePreferNone = 0,
  __pyx_e_4cuda_7ccudart_cudaFuncCachePreferShared = 1,
  __pyx_e_4cuda_7ccudart_cudaFuncCachePreferL1 = 2,
  __pyx_e_4cuda_7ccudart_cudaFuncCachePreferEqual = 3
};

/* "cuda/ccudart.pxd":468
 *     cudaFuncCachePreferEqual = 3
 * 
 * cdef enum cudaSharedMemConfig:             # <<<<<<<<<<<<<<
 *     cudaSharedMemBankSizeDefault = 0
 *     cudaSharedMemBankSizeFourByte = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaSharedMemConfig {
  __pyx_e_4cuda_7ccudart_cudaSharedMemBankSizeDefault = 0,
  __pyx_e_4cuda_7ccudart_cudaSharedMemBankSizeFourByte = 1,
  __pyx_e_4cuda_7ccudart_cudaSharedMemBankSizeEightByte = 2
};

/* "cuda/ccudart.pxd":473
 *     cudaSharedMemBankSizeEightByte = 2
 * 
 * cdef enum cudaSharedCarveout:             # <<<<<<<<<<<<<<
 *     cudaSharedmemCarveoutDefault = -1
 *     cudaSharedmemCarveoutMaxShared = 100
 */
enum __pyx_t_4cuda_7ccudart_cudaSharedCarveout {
  __pyx_e_4cuda_7ccudart_cudaSharedmemCarveoutDefault = -1L,
  __pyx_e_4cuda_7ccudart_cudaSharedmemCarveoutMaxShared = 0x64,
  __pyx_e_4cuda_7ccudart_cudaSharedmemCarveoutMaxL1 = 0
};

/* "cuda/ccudart.pxd":478
 *     cudaSharedmemCarveoutMaxL1 = 0
 * 
 * cdef enum cudaComputeMode:             # <<<<<<<<<<<<<<
 *     cudaComputeModeDefault = 0
 *     cudaComputeModeExclusive = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaComputeMode {
  __pyx_e_4cuda_7ccudart_cudaComputeModeDefault = 0,
  __pyx_e_4cuda_7ccudart_cudaComputeModeExclusive = 1,
  __pyx_e_4cuda_7ccudart_cudaComputeModeProhibited = 2,
  __pyx_e_4cuda_7ccudart_cudaComputeModeExclusiveProcess = 3
};

/* "cuda/ccudart.pxd":484
 *     cudaComputeModeExclusiveProcess = 3
 * 
 * cdef enum cudaLimit:             # <<<<<<<<<<<<<<
 *     cudaLimitStackSize = 0x00
 *     cudaLimitPrintfFifoSize = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaLimit {
  __pyx_e_4cuda_7ccudart_cudaLimitStackSize = 0x00,
  __pyx_e_4cuda_7ccudart_cudaLimitPrintfFifoSize = 0x01,
  __pyx_e_4cuda_7ccudart_cudaLimitMallocHeapSize = 0x02,
  __pyx_e_4cuda_7ccudart_cudaLimitDevRuntimeSyncDepth = 0x03,
  __pyx_e_4cuda_7ccudart_cudaLimitDevRuntimePendingLaunchCount = 0x04,
  __pyx_e_4cuda_7ccudart_cudaLimitMaxL2FetchGranularity = 0x05,
  __pyx_e_4cuda_7ccudart_cudaLimitPersistingL2CacheSize = 0x06
};

/* "cuda/ccudart.pxd":493
 *     cudaLimitPersistingL2CacheSize = 0x06
 * 
 * cdef enum cudaMemoryAdvise:             # <<<<<<<<<<<<<<
 *     cudaMemAdviseSetReadMostly = 1
 *     cudaMemAdviseUnsetReadMostly = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaMemoryAdvise {
  __pyx_e_4cuda_7ccudart_cudaMemAdviseSetReadMostly = 1,
  __pyx_e_4cuda_7ccudart_cudaMemAdviseUnsetReadMostly = 2,
  __pyx_e_4cuda_7ccudart_cudaMemAdviseSetPreferredLocation = 3,
  __pyx_e_4cuda_7ccudart_cudaMemAdviseUnsetPreferredLocation = 4,
  __pyx_e_4cuda_7ccudart_cudaMemAdviseSetAccessedBy = 5,
  __pyx_e_4cuda_7ccudart_cudaMemAdviseUnsetAccessedBy = 6
};

/* "cuda/ccudart.pxd":501
 *     cudaMemAdviseUnsetAccessedBy = 6
 * 
 * cdef enum cudaMemRangeAttribute:             # <<<<<<<<<<<<<<
 *     cudaMemRangeAttributeReadMostly = 1
 *     cudaMemRangeAttributePreferredLocation = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaMemRangeAttribute {
  __pyx_e_4cuda_7ccudart_cudaMemRangeAttributeReadMostly = 1,
  __pyx_e_4cuda_7ccudart_cudaMemRangeAttributePreferredLocation = 2,
  __pyx_e_4cuda_7ccudart_cudaMemRangeAttributeAccessedBy = 3,
  __pyx_e_4cuda_7ccudart_cudaMemRangeAttributeLastPrefetchLocation = 4
};

/* "cuda/ccudart.pxd":507
 *     cudaMemRangeAttributeLastPrefetchLocation = 4
 * 
 * cdef enum cudaOutputMode:             # <<<<<<<<<<<<<<
 *     cudaKeyValuePair = 0x00
 *     cudaCSV = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaOutputMode {
  __pyx_e_4cuda_7ccudart_cudaKeyValuePair = 0x00,
  __pyx_e_4cuda_7ccudart_cudaCSV = 0x01
};

/* "cuda/ccudart.pxd":511
 *     cudaCSV = 0x01
 * 
 * cdef enum cudaFlushGPUDirectRDMAWritesOptions:             # <<<<<<<<<<<<<<
 *     cudaFlushGPUDirectRDMAWritesOptionHost = 1<<0
 *     cudaFlushGPUDirectRDMAWritesOptionMemOps = 1<<1
 */
enum __pyx_t_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesOptions {

  /* "cuda/ccudart.pxd":513
 * cdef enum cudaFlushGPUDirectRDMAWritesOptions:
 *     cudaFlushGPUDirectRDMAWritesOptionHost = 1<<0
 *     cudaFlushGPUDirectRDMAWritesOptionMemOps = 1<<1             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGPUDirectRDMAWritesOrdering:
 */
  __pyx_e_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesOptionHost = (1 << 0),
  __pyx_e_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesOptionMemOps = (1 << 1)
};

/* "cuda/ccudart.pxd":515
 *     cudaFlushGPUDirectRDMAWritesOptionMemOps = 1<<1
 * 
 * cdef enum cudaGPUDirectRDMAWritesOrdering:             # <<<<<<<<<<<<<<
 *     cudaGPUDirectRDMAWritesOrderingNone = 0
 *     cudaGPUDirectRDMAWritesOrderingOwner = 100
 */
enum __pyx_t_4cuda_7ccudart_cudaGPUDirectRDMAWritesOrdering {
  __pyx_e_4cuda_7ccudart_cudaGPUDirectRDMAWritesOrderingNone = 0,
  __pyx_e_4cuda_7ccudart_cudaGPUDirectRDMAWritesOrderingOwner = 0x64,
  __pyx_e_4cuda_7ccudart_cudaGPUDirectRDMAWritesOrderingAllDevices = 0xC8
};

/* "cuda/ccudart.pxd":520
 *     cudaGPUDirectRDMAWritesOrderingAllDevices = 200
 * 
 * cdef enum cudaFlushGPUDirectRDMAWritesScope:             # <<<<<<<<<<<<<<
 *     cudaFlushGPUDirectRDMAWritesToOwner = 100
 *     cudaFlushGPUDirectRDMAWritesToAllDevices = 200
 */
enum __pyx_t_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesScope {
  __pyx_e_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesToOwner = 0x64,
  __pyx_e_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesToAllDevices = 0xC8
};

/* "cuda/ccudart.pxd":524
 *     cudaFlushGPUDirectRDMAWritesToAllDevices = 200
 * 
 * cdef enum cudaFlushGPUDirectRDMAWritesTarget:             # <<<<<<<<<<<<<<
 *     cudaFlushGPUDirectRDMAWritesTargetCurrentDevice
 * 
 */
enum __pyx_t_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesTarget {
  __pyx_e_4cuda_7ccudart_cudaFlushGPUDirectRDMAWritesTargetCurrentDevice
};

/* "cuda/ccudart.pxd":527
 *     cudaFlushGPUDirectRDMAWritesTargetCurrentDevice
 * 
 * cdef enum cudaDeviceAttr:             # <<<<<<<<<<<<<<
 *     cudaDevAttrMaxThreadsPerBlock = 1
 *     cudaDevAttrMaxBlockDimX = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaDeviceAttr {
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxThreadsPerBlock = 1,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxBlockDimX = 2,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxBlockDimY = 3,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxBlockDimZ = 4,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxGridDimX = 5,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxGridDimY = 6,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxGridDimZ = 7,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSharedMemoryPerBlock = 8,
  __pyx_e_4cuda_7ccudart_cudaDevAttrTotalConstantMemory = 9,
  __pyx_e_4cuda_7ccudart_cudaDevAttrWarpSize = 10,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxPitch = 11,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxRegistersPerBlock = 12,
  __pyx_e_4cuda_7ccudart_cudaDevAttrClockRate = 13,
  __pyx_e_4cuda_7ccudart_cudaDevAttrTextureAlignment = 14,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGpuOverlap = 15,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMultiProcessorCount = 16,
  __pyx_e_4cuda_7ccudart_cudaDevAttrKernelExecTimeout = 17,
  __pyx_e_4cuda_7ccudart_cudaDevAttrIntegrated = 18,
  __pyx_e_4cuda_7ccudart_cudaDevAttrCanMapHostMemory = 19,
  __pyx_e_4cuda_7ccudart_cudaDevAttrComputeMode = 20,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture1DWidth = 21,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DWidth = 22,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DHeight = 23,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DWidth = 24,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DHeight = 25,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DDepth = 26,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLayeredWidth = 27,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLayeredHeight = 28,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLayeredLayers = 29,
  __pyx_e_4cuda_7ccudart_cudaDevAttrSurfaceAlignment = 30,
  __pyx_e_4cuda_7ccudart_cudaDevAttrConcurrentKernels = 31,
  __pyx_e_4cuda_7ccudart_cudaDevAttrEccEnabled = 32,
  __pyx_e_4cuda_7ccudart_cudaDevAttrPciBusId = 33,
  __pyx_e_4cuda_7ccudart_cudaDevAttrPciDeviceId = 34,
  __pyx_e_4cuda_7ccudart_cudaDevAttrTccDriver = 35,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMemoryClockRate = 36,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGlobalMemoryBusWidth = 37,
  __pyx_e_4cuda_7ccudart_cudaDevAttrL2CacheSize = 38,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxThreadsPerMultiProcessor = 39,
  __pyx_e_4cuda_7ccudart_cudaDevAttrAsyncEngineCount = 40,
  __pyx_e_4cuda_7ccudart_cudaDevAttrUnifiedAddressing = 41,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture1DLayeredWidth = 42,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture1DLayeredLayers = 43,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DGatherWidth = 45,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DGatherHeight = 46,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DWidthAlt = 47,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DHeightAlt = 48,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture3DDepthAlt = 49,
  __pyx_e_4cuda_7ccudart_cudaDevAttrPciDomainId = 50,
  __pyx_e_4cuda_7ccudart_cudaDevAttrTexturePitchAlignment = 51,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTextureCubemapWidth = 52,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTextureCubemapLayeredWidth = 53,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTextureCubemapLayeredLayers = 54,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface1DWidth = 55,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface2DWidth = 56,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface2DHeight = 57,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface3DWidth = 58,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface3DHeight = 59,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface3DDepth = 60,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface1DLayeredWidth = 61,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface1DLayeredLayers = 62,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface2DLayeredWidth = 63,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface2DLayeredHeight = 64,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurface2DLayeredLayers = 65,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurfaceCubemapWidth = 66,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture1DLinearWidth = 69,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLinearWidth = 70,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLinearHeight = 71,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DLinearPitch = 72,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DMipmappedWidth = 73,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture2DMipmappedHeight = 74,
  __pyx_e_4cuda_7ccudart_cudaDevAttrComputeCapabilityMajor = 75,
  __pyx_e_4cuda_7ccudart_cudaDevAttrComputeCapabilityMinor = 76,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTexture1DMipmappedWidth = 77,
  __pyx_e_4cuda_7ccudart_cudaDevAttrStreamPrioritiesSupported = 78,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGlobalL1CacheSupported = 79,
  __pyx_e_4cuda_7ccudart_cudaDevAttrLocalL1CacheSupported = 80,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxRegistersPerMultiprocessor = 82,
  __pyx_e_4cuda_7ccudart_cudaDevAttrManagedMemory = 83,
  __pyx_e_4cuda_7ccudart_cudaDevAttrIsMultiGpuBoard = 84,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMultiGpuBoardGroupID = 85,
  __pyx_e_4cuda_7ccudart_cudaDevAttrHostNativeAtomicSupported = 86,
  __pyx_e_4cuda_7ccudart_cudaDevAttrSingleToDoublePrecisionPerfRatio = 87,
  __pyx_e_4cuda_7ccudart_cudaDevAttrPageableMemoryAccess = 88,
  __pyx_e_4cuda_7ccudart_cudaDevAttrConcurrentManagedAccess = 89,
  __pyx_e_4cuda_7ccudart_cudaDevAttrComputePreemptionSupported = 90,
  __pyx_e_4cuda_7ccudart_cudaDevAttrCanUseHostPointerForRegisteredMem = 91,
  __pyx_e_4cuda_7ccudart_cudaDevAttrReserved92 = 92,
  __pyx_e_4cuda_7ccudart_cudaDevAttrReserved93 = 93,
  __pyx_e_4cuda_7ccudart_cudaDevAttrReserved94 = 94,
  __pyx_e_4cuda_7ccudart_cudaDevAttrCooperativeLaunch = 95,
  __pyx_e_4cuda_7ccudart_cudaDevAttrCooperativeMultiDeviceLaunch = 96,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxSharedMemoryPerBlockOptin = 97,
  __pyx_e_4cuda_7ccudart_cudaDevAttrCanFlushRemoteWrites = 98,
  __pyx_e_4cuda_7ccudart_cudaDevAttrHostRegisterSupported = 99,
  __pyx_e_4cuda_7ccudart_cudaDevAttrPageableMemoryAccessUsesHostPageTables = 0x64,
  __pyx_e_4cuda_7ccudart_cudaDevAttrDirectManagedMemAccessFromHost = 0x65,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxBlocksPerMultiprocessor = 0x6A,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxPersistingL2CacheSize = 0x6C,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxAccessPolicyWindowSize = 0x6D,
  __pyx_e_4cuda_7ccudart_cudaDevAttrReservedSharedMemoryPerBlock = 0x6F,
  __pyx_e_4cuda_7ccudart_cudaDevAttrSparseCudaArraySupported = 0x70,
  __pyx_e_4cuda_7ccudart_cudaDevAttrHostRegisterReadOnlySupported = 0x71,
  __pyx_e_4cuda_7ccudart_cudaDevAttrTimelineSemaphoreInteropSupported = 0x72,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMaxTimelineSemaphoreInteropSupported = 0x72,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMemoryPoolsSupported = 0x73,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGPUDirectRDMASupported = 0x74,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGPUDirectRDMAFlushWritesOptions = 0x75,
  __pyx_e_4cuda_7ccudart_cudaDevAttrGPUDirectRDMAWritesOrdering = 0x76,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMemoryPoolSupportedHandleTypes = 0x77,
  __pyx_e_4cuda_7ccudart_cudaDevAttrMax
};

/* "cuda/ccudart.pxd":643
 *     cudaDevAttrMax
 * 
 * cdef enum cudaMemPoolAttr:             # <<<<<<<<<<<<<<
 *     cudaMemPoolReuseFollowEventDependencies = 0x1
 *     cudaMemPoolReuseAllowOpportunistic = 0x2
 */
enum __pyx_t_4cuda_7ccudart_cudaMemPoolAttr {
  __pyx_e_4cuda_7ccudart_cudaMemPoolReuseFollowEventDependencies = 0x1,
  __pyx_e_4cuda_7ccudart_cudaMemPoolReuseAllowOpportunistic = 0x2,
  __pyx_e_4cuda_7ccudart_cudaMemPoolReuseAllowInternalDependencies = 0x3,
  __pyx_e_4cuda_7ccudart_cudaMemPoolAttrReleaseThreshold = 0x4,
  __pyx_e_4cuda_7ccudart_cudaMemPoolAttrReservedMemCurrent = 0x5,
  __pyx_e_4cuda_7ccudart_cudaMemPoolAttrReservedMemHigh = 0x6,
  __pyx_e_4cuda_7ccudart_cudaMemPoolAttrUsedMemCurrent = 0x7,
  __pyx_e_4cuda_7ccudart_cudaMemPoolAttrUsedMemHigh = 0x8
};

/* "cuda/ccudart.pxd":653
 *     cudaMemPoolAttrUsedMemHigh = 0x8
 * 
 * cdef enum cudaMemLocationType:             # <<<<<<<<<<<<<<
 *     cudaMemLocationTypeInvalid = 0
 *     cudaMemLocationTypeDevice = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemLocationType {
  __pyx_e_4cuda_7ccudart_cudaMemLocationTypeInvalid = 0,
  __pyx_e_4cuda_7ccudart_cudaMemLocationTypeDevice = 1
};

/* "cuda/ccudart.pxd":661
 *     int id
 * 
 * cdef enum cudaMemAccessFlags:             # <<<<<<<<<<<<<<
 *     cudaMemAccessFlagsProtNone = 0
 *     cudaMemAccessFlagsProtRead = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemAccessFlags {
  __pyx_e_4cuda_7ccudart_cudaMemAccessFlagsProtNone = 0,
  __pyx_e_4cuda_7ccudart_cudaMemAccessFlagsProtRead = 1,
  __pyx_e_4cuda_7ccudart_cudaMemAccessFlagsProtReadWrite = 3
};

/* "cuda/ccudart.pxd":670
 *     cudaMemAccessFlags flags
 * 
 * cdef enum cudaMemAllocationType:             # <<<<<<<<<<<<<<
 *     cudaMemAllocationTypeInvalid = 0x0
 *     cudaMemAllocationTypePinned = 0x1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemAllocationType {
  __pyx_e_4cuda_7ccudart_cudaMemAllocationTypeInvalid = 0x0,
  __pyx_e_4cuda_7ccudart_cudaMemAllocationTypePinned = 0x1,
  __pyx_e_4cuda_7ccudart_cudaMemAllocationTypeMax = 0x7FFFFFFF
};

/* "cuda/ccudart.pxd":675
 *     cudaMemAllocationTypeMax = 0x7FFFFFFF
 * 
 * cdef enum cudaMemAllocationHandleType:             # <<<<<<<<<<<<<<
 *     cudaMemHandleTypeNone = 0x0
 *     cudaMemHandleTypePosixFileDescriptor = 0x1
 */
enum __pyx_t_4cuda_7ccudart_cudaMemAllocationHandleType {
  __pyx_e_4cuda_7ccudart_cudaMemHandleTypeNone = 0x0,
  __pyx_e_4cuda_7ccudart_cudaMemHandleTypePosixFileDescriptor = 0x1,
  __pyx_e_4cuda_7ccudart_cudaMemHandleTypeWin32 = 0x2,
  __pyx_e_4cuda_7ccudart_cudaMemHandleTypeWin32Kmt = 0x4
};

/* "cuda/ccudart.pxd":698
 *     void* dptr
 * 
 * cdef enum cudaGraphMemAttributeType:             # <<<<<<<<<<<<<<
 *     cudaGraphMemAttrUsedMemCurrent = 0x1
 *     cudaGraphMemAttrUsedMemHigh = 0x2
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphMemAttributeType {
  __pyx_e_4cuda_7ccudart_cudaGraphMemAttrUsedMemCurrent = 0x1,
  __pyx_e_4cuda_7ccudart_cudaGraphMemAttrUsedMemHigh = 0x2,
  __pyx_e_4cuda_7ccudart_cudaGraphMemAttrReservedMemCurrent = 0x3,
  __pyx_e_4cuda_7ccudart_cudaGraphMemAttrReservedMemHigh = 0x4
};

/* "cuda/ccudart.pxd":704
 *     cudaGraphMemAttrReservedMemHigh = 0x4
 * 
 * cdef enum cudaDeviceP2PAttr:             # <<<<<<<<<<<<<<
 *     cudaDevP2PAttrPerformanceRank = 1
 *     cudaDevP2PAttrAccessSupported = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaDeviceP2PAttr {
  __pyx_e_4cuda_7ccudart_cudaDevP2PAttrPerformanceRank = 1,
  __pyx_e_4cuda_7ccudart_cudaDevP2PAttrAccessSupported = 2,
  __pyx_e_4cuda_7ccudart_cudaDevP2PAttrNativeAtomicSupported = 3,
  __pyx_e_4cuda_7ccudart_cudaDevP2PAttrCudaArrayAccessSupported = 4
};

/* "cuda/ccudart.pxd":809
 * ctypedef cudaIpcMemHandle_st cudaIpcMemHandle_t
 * 
 * cdef enum cudaExternalMemoryHandleType:             # <<<<<<<<<<<<<<
 *     cudaExternalMemoryHandleTypeOpaqueFd = 1
 *     cudaExternalMemoryHandleTypeOpaqueWin32 = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleType {
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueFd = 1,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueWin32 = 2,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D12Heap = 4,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D12Resource = 5,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D11Resource = 6,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7,
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeNvSciBuf = 8
};

/* "cuda/ccudart.pxd":846
 *     unsigned int numLevels
 * 
 * cdef enum cudaExternalSemaphoreHandleType:             # <<<<<<<<<<<<<<
 *     cudaExternalSemaphoreHandleTypeOpaqueFd = 1
 *     cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2
 */
enum __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleType {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueFd = 1,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeD3D12Fence = 4,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeD3D11Fence = 5,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeNvSciSync = 6,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeKeyedMutex = 7,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9,
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10
};

/* "cuda/ccudart.pxd":969
 * ctypedef CUmemPoolHandle_st* cudaMemPool_t
 * 
 * cdef enum cudaCGScope:             # <<<<<<<<<<<<<<
 *     cudaCGScopeInvalid = 0
 *     cudaCGScopeGrid = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaCGScope {
  __pyx_e_4cuda_7ccudart_cudaCGScopeInvalid = 0,
  __pyx_e_4cuda_7ccudart_cudaCGScopeGrid = 1,
  __pyx_e_4cuda_7ccudart_cudaCGScopeMultiGrid = 2
};

/* "cuda/ccudart.pxd":992
 *     unsigned int numExtSems
 * 
 * cdef enum cudaGraphNodeType:             # <<<<<<<<<<<<<<
 *     cudaGraphNodeTypeKernel = 0x00
 *     cudaGraphNodeTypeMemcpy = 0x01
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphNodeType {
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeKernel = 0x00,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeMemcpy = 0x01,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeMemset = 0x02,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeHost = 0x03,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeGraph = 0x04,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeEmpty = 0x05,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeWaitEvent = 0x06,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeEventRecord = 0x07,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeExtSemaphoreSignal = 0x08,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeExtSemaphoreWait = 0x09,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeMemAlloc = 0x0a,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeMemFree = 0x0b,
  __pyx_e_4cuda_7ccudart_cudaGraphNodeTypeCount
};

/* "cuda/ccudart.pxd":1012
 * ctypedef CUgraphExec_st* cudaGraphExec_t
 * 
 * cdef enum cudaGraphExecUpdateResult:             # <<<<<<<<<<<<<<
 *     cudaGraphExecUpdateSuccess = 0x0
 *     cudaGraphExecUpdateError = 0x1
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphExecUpdateResult {
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateSuccess = 0x0,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateError = 0x1,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorTopologyChanged = 0x2,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorNodeTypeChanged = 0x3,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorFunctionChanged = 0x4,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorParametersChanged = 0x5,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorNotSupported = 0x6,
  __pyx_e_4cuda_7ccudart_cudaGraphExecUpdateErrorUnsupportedFunctionChange = 0x7
};

/* "cuda/ccudart.pxd":1022
 *     cudaGraphExecUpdateErrorUnsupportedFunctionChange = 0x7
 * 
 * cdef enum cudaGetDriverEntryPointFlags:             # <<<<<<<<<<<<<<
 *     cudaEnableDefault = 0x0
 *     cudaEnableLegacyStream = 0x1
 */
enum __pyx_t_4cuda_7ccudart_cudaGetDriverEntryPointFlags {
  __pyx_e_4cuda_7ccudart_cudaEnableDefault = 0x0,
  __pyx_e_4cuda_7ccudart_cudaEnableLegacyStream = 0x1,
  __pyx_e_4cuda_7ccudart_cudaEnablePerThreadDefaultStream = 0x2
};

/* "cuda/ccudart.pxd":1027
 *     cudaEnablePerThreadDefaultStream = 0x2
 * 
 * cdef enum cudaGraphDebugDotFlags:             # <<<<<<<<<<<<<<
 *     cudaGraphDebugDotFlagsVerbose = 1<<0
 *     cudaGraphDebugDotFlagsKernelNodeParams = 1<<2
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphDebugDotFlags {

  /* "cuda/ccudart.pxd":1037
 *     cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 1<<8
 *     cudaGraphDebugDotFlagsKernelNodeAttributes = 1<<9
 *     cudaGraphDebugDotFlagsHandles = 1<<10             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGraphInstantiateFlags:
 */
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsVerbose = (1 << 0),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsKernelNodeParams = (1 << 2),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsMemcpyNodeParams = (1 << 3),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsMemsetNodeParams = (1 << 4),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsHostNodeParams = (1 << 5),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsEventNodeParams = (1 << 6),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsExtSemasSignalNodeParams = (1 << 7),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsExtSemasWaitNodeParams = (1 << 8),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsKernelNodeAttributes = (1 << 9),
  __pyx_e_4cuda_7ccudart_cudaGraphDebugDotFlagsHandles = (1 << 10)
};

/* "cuda/ccudart.pxd":1039
 *     cudaGraphDebugDotFlagsHandles = 1<<10
 * 
 * cdef enum cudaGraphInstantiateFlags:             # <<<<<<<<<<<<<<
 *     cudaGraphInstantiateFlagAutoFreeOnLaunch = 1
 * 
 */
enum __pyx_t_4cuda_7ccudart_cudaGraphInstantiateFlags {
  __pyx_e_4cuda_7ccudart_cudaGraphInstantiateFlagAutoFreeOnLaunch = 1
};

/* "cuda/ccudart.pxd":1042
 *     cudaGraphInstantiateFlagAutoFreeOnLaunch = 1
 * 
 * cdef enum cudaSurfaceBoundaryMode:             # <<<<<<<<<<<<<<
 *     cudaBoundaryModeZero = 0
 *     cudaBoundaryModeClamp = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaSurfaceBoundaryMode {
  __pyx_e_4cuda_7ccudart_cudaBoundaryModeZero = 0,
  __pyx_e_4cuda_7ccudart_cudaBoundaryModeClamp = 1,
  __pyx_e_4cuda_7ccudart_cudaBoundaryModeTrap = 2
};

/* "cuda/ccudart.pxd":1047
 *     cudaBoundaryModeTrap = 2
 * 
 * cdef enum cudaSurfaceFormatMode:             # <<<<<<<<<<<<<<
 *     cudaFormatModeForced = 0
 *     cudaFormatModeAuto = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaSurfaceFormatMode {
  __pyx_e_4cuda_7ccudart_cudaFormatModeForced = 0,
  __pyx_e_4cuda_7ccudart_cudaFormatModeAuto = 1
};

/* "cuda/ccudart.pxd":1053
 * ctypedef unsigned long long cudaSurfaceObject_t
 * 
 * cdef enum cudaTextureAddressMode:             # <<<<<<<<<<<<<<
 *     cudaAddressModeWrap = 0
 *     cudaAddressModeClamp = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaTextureAddressMode {
  __pyx_e_4cuda_7ccudart_cudaAddressModeWrap = 0,
  __pyx_e_4cuda_7ccudart_cudaAddressModeClamp = 1,
  __pyx_e_4cuda_7ccudart_cudaAddressModeMirror = 2,
  __pyx_e_4cuda_7ccudart_cudaAddressModeBorder = 3
};

/* "cuda/ccudart.pxd":1059
 *     cudaAddressModeBorder = 3
 * 
 * cdef enum cudaTextureFilterMode:             # <<<<<<<<<<<<<<
 *     cudaFilterModePoint = 0
 *     cudaFilterModeLinear = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaTextureFilterMode {
  __pyx_e_4cuda_7ccudart_cudaFilterModePoint = 0,
  __pyx_e_4cuda_7ccudart_cudaFilterModeLinear = 1
};

/* "cuda/ccudart.pxd":1063
 *     cudaFilterModeLinear = 1
 * 
 * cdef enum cudaTextureReadMode:             # <<<<<<<<<<<<<<
 *     cudaReadModeElementType = 0
 *     cudaReadModeNormalizedFloat = 1
 */
enum __pyx_t_4cuda_7ccudart_cudaTextureReadMode {
  __pyx_e_4cuda_7ccudart_cudaReadModeElementType = 0,
  __pyx_e_4cuda_7ccudart_cudaReadModeNormalizedFloat = 1
};

/* "cuda/ccudart.pxd":1083
 * ctypedef unsigned long long cudaTextureObject_t
 * 
 * cdef enum cudaDataType_t:             # <<<<<<<<<<<<<<
 *     CUDA_R_16F = 2
 *     CUDA_C_16F = 6
 */
enum __pyx_t_4cuda_7ccudart_cudaDataType_t {
  __pyx_e_4cuda_7ccudart_CUDA_R_16F = 2,
  __pyx_e_4cuda_7ccudart_CUDA_C_16F = 6,
  __pyx_e_4cuda_7ccudart_CUDA_R_16BF = 14,
  __pyx_e_4cuda_7ccudart_CUDA_C_16BF = 15,
  __pyx_e_4cuda_7ccudart_CUDA_R_32F = 0,
  __pyx_e_4cuda_7ccudart_CUDA_C_32F = 4,
  __pyx_e_4cuda_7ccudart_CUDA_R_64F = 1,
  __pyx_e_4cuda_7ccudart_CUDA_C_64F = 5,
  __pyx_e_4cuda_7ccudart_CUDA_R_4I = 16,
  __pyx_e_4cuda_7ccudart_CUDA_C_4I = 17,
  __pyx_e_4cuda_7ccudart_CUDA_R_4U = 18,
  __pyx_e_4cuda_7ccudart_CUDA_C_4U = 19,
  __pyx_e_4cuda_7ccudart_CUDA_R_8I = 3,
  __pyx_e_4cuda_7ccudart_CUDA_C_8I = 7,
  __pyx_e_4cuda_7ccudart_CUDA_R_8U = 8,
  __pyx_e_4cuda_7ccudart_CUDA_C_8U = 9,
  __pyx_e_4cuda_7ccudart_CUDA_R_16I = 20,
  __pyx_e_4cuda_7ccudart_CUDA_C_16I = 21,
  __pyx_e_4cuda_7ccudart_CUDA_R_16U = 22,
  __pyx_e_4cuda_7ccudart_CUDA_C_16U = 23,
  __pyx_e_4cuda_7ccudart_CUDA_R_32I = 10,
  __pyx_e_4cuda_7ccudart_CUDA_C_32I = 11,
  __pyx_e_4cuda_7ccudart_CUDA_R_32U = 12,
  __pyx_e_4cuda_7ccudart_CUDA_C_32U = 13,
  __pyx_e_4cuda_7ccudart_CUDA_R_64I = 24,
  __pyx_e_4cuda_7ccudart_CUDA_C_64I = 25,
  __pyx_e_4cuda_7ccudart_CUDA_R_64U = 26,
  __pyx_e_4cuda_7ccudart_CUDA_C_64U = 27
};

/* "cuda/ccudart.pxd":1115
 * ctypedef cudaDataType_t cudaDataType
 * 
 * cdef enum libraryPropertyType_t:             # <<<<<<<<<<<<<<
 *     MAJOR_VERSION
 *     MINOR_VERSION
 */
enum __pyx_t_4cuda_7ccudart_libraryPropertyType_t {
  __pyx_e_4cuda_7ccudart_MAJOR_VERSION,
  __pyx_e_4cuda_7ccudart_MINOR_VERSION,
  __pyx_e_4cuda_7ccudart_PATCH_LEVEL
};

/* "cuda/ccudart.pxd":1640
 * cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) nogil
 * 
 * cdef enum: cudaHostAllocDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocPortable = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocDefault = 0x00
};

/* "cuda/ccudart.pxd":1642
 * cdef enum: cudaHostAllocDefault = 0x00
 * 
 * cdef enum: cudaHostAllocPortable = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocMapped = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocPortable = 0x01
};

/* "cuda/ccudart.pxd":1644
 * cdef enum: cudaHostAllocPortable = 0x01
 * 
 * cdef enum: cudaHostAllocMapped = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocWriteCombined = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocMapped = 0x02
};

/* "cuda/ccudart.pxd":1646
 * cdef enum: cudaHostAllocMapped = 0x02
 * 
 * cdef enum: cudaHostAllocWriteCombined = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocWriteCombined = 0x04
};

/* "cuda/ccudart.pxd":1648
 * cdef enum: cudaHostAllocWriteCombined = 0x04
 * 
 * cdef enum: cudaHostRegisterDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterPortable = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterDefault = 0x00
};

/* "cuda/ccudart.pxd":1650
 * cdef enum: cudaHostRegisterDefault = 0x00
 * 
 * cdef enum: cudaHostRegisterPortable = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterMapped = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterPortable = 0x01
};

/* "cuda/ccudart.pxd":1652
 * cdef enum: cudaHostRegisterPortable = 0x01
 * 
 * cdef enum: cudaHostRegisterMapped = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterIoMemory = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterMapped = 0x02
};

/* "cuda/ccudart.pxd":1654
 * cdef enum: cudaHostRegisterMapped = 0x02
 * 
 * cdef enum: cudaHostRegisterIoMemory = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostRegisterReadOnly = 0x08
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterIoMemory = 0x04
};

/* "cuda/ccudart.pxd":1656
 * cdef enum: cudaHostRegisterIoMemory = 0x04
 * 
 * cdef enum: cudaHostRegisterReadOnly = 0x08             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaPeerAccessDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostRegisterReadOnly = 0x08
};

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

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

/* "cuda/ccudart.pxd":1662
 * cdef enum: cudaStreamDefault = 0x00
 * 
 * cdef enum: cudaStreamNonBlocking = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamLegacy = 0x1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamNonBlocking = 0x01
};

/* "cuda/ccudart.pxd":1664
 * cdef enum: cudaStreamNonBlocking = 0x01
 * 
 * cdef enum: cudaStreamLegacy = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamPerThread = 0x2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamLegacy = 0x1
};

/* "cuda/ccudart.pxd":1666
 * cdef enum: cudaStreamLegacy = 0x1
 * 
 * cdef enum: cudaStreamPerThread = 0x2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamPerThread = 0x2
};

/* "cuda/ccudart.pxd":1668
 * cdef enum: cudaStreamPerThread = 0x2
 * 
 * cdef enum: cudaEventDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventBlockingSync = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventDefault = 0x00
};

/* "cuda/ccudart.pxd":1670
 * cdef enum: cudaEventDefault = 0x00
 * 
 * cdef enum: cudaEventBlockingSync = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventDisableTiming = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventBlockingSync = 0x01
};

/* "cuda/ccudart.pxd":1672
 * cdef enum: cudaEventBlockingSync = 0x01
 * 
 * cdef enum: cudaEventDisableTiming = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventInterprocess = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventDisableTiming = 0x02
};

/* "cuda/ccudart.pxd":1674
 * cdef enum: cudaEventDisableTiming = 0x02
 * 
 * cdef enum: cudaEventInterprocess = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventRecordDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventInterprocess = 0x04
};

/* "cuda/ccudart.pxd":1676
 * cdef enum: cudaEventInterprocess = 0x04
 * 
 * cdef enum: cudaEventRecordDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaEventRecordExternal = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaEventRecordDefault = 0x00
};

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

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

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

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

/* "cuda/ccudart.pxd":1686
 * cdef enum: cudaDeviceScheduleAuto = 0x00
 * 
 * cdef enum: cudaDeviceScheduleSpin = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleYield = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleSpin = 0x01
};

/* "cuda/ccudart.pxd":1688
 * cdef enum: cudaDeviceScheduleSpin = 0x01
 * 
 * cdef enum: cudaDeviceScheduleYield = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleBlockingSync = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleYield = 0x02
};

/* "cuda/ccudart.pxd":1690
 * cdef enum: cudaDeviceScheduleYield = 0x02
 * 
 * cdef enum: cudaDeviceScheduleBlockingSync = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceBlockingSync = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleBlockingSync = 0x04
};

/* "cuda/ccudart.pxd":1692
 * cdef enum: cudaDeviceScheduleBlockingSync = 0x04
 * 
 * cdef enum: cudaDeviceBlockingSync = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceScheduleMask = 0x07
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceBlockingSync = 0x04
};

/* "cuda/ccudart.pxd":1694
 * cdef enum: cudaDeviceBlockingSync = 0x04
 * 
 * cdef enum: cudaDeviceScheduleMask = 0x07             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceMapHost = 0x08
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceScheduleMask = 0x07
};

/* "cuda/ccudart.pxd":1696
 * cdef enum: cudaDeviceScheduleMask = 0x07
 * 
 * cdef enum: cudaDeviceMapHost = 0x08             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceLmemResizeToMax = 0x10
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceMapHost = 0x08
};

/* "cuda/ccudart.pxd":1698
 * cdef enum: cudaDeviceMapHost = 0x08
 * 
 * cdef enum: cudaDeviceLmemResizeToMax = 0x10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceMask = 0x1f
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceLmemResizeToMax = 0x10
};

/* "cuda/ccudart.pxd":1700
 * cdef enum: cudaDeviceLmemResizeToMax = 0x10
 * 
 * cdef enum: cudaDeviceMask = 0x1f             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceMask = 0x1f
};

/* "cuda/ccudart.pxd":1702
 * cdef enum: cudaDeviceMask = 0x1f
 * 
 * cdef enum: cudaArrayDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayLayered = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayDefault = 0x00
};

/* "cuda/ccudart.pxd":1704
 * cdef enum: cudaArrayDefault = 0x00
 * 
 * cdef enum: cudaArrayLayered = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySurfaceLoadStore = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayLayered = 0x01
};

/* "cuda/ccudart.pxd":1706
 * cdef enum: cudaArrayLayered = 0x01
 * 
 * cdef enum: cudaArraySurfaceLoadStore = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayCubemap = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySurfaceLoadStore = 0x02
};

/* "cuda/ccudart.pxd":1708
 * cdef enum: cudaArraySurfaceLoadStore = 0x02
 * 
 * cdef enum: cudaArrayCubemap = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayTextureGather = 0x08
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayCubemap = 0x04
};

/* "cuda/ccudart.pxd":1710
 * cdef enum: cudaArrayCubemap = 0x04
 * 
 * cdef enum: cudaArrayTextureGather = 0x08             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayColorAttachment = 0x20
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayTextureGather = 0x08
};

/* "cuda/ccudart.pxd":1712
 * cdef enum: cudaArrayTextureGather = 0x08
 * 
 * cdef enum: cudaArrayColorAttachment = 0x20             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySparse = 0x40
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArrayColorAttachment = 0x20
};

/* "cuda/ccudart.pxd":1714
 * cdef enum: cudaArrayColorAttachment = 0x20
 * 
 * cdef enum: cudaArraySparse = 0x40             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySparse = 0x40
};

/* "cuda/ccudart.pxd":1716
 * cdef enum: cudaArraySparse = 0x40
 * 
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachGlobal = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaIpcMemLazyEnablePeerAccess = 0x01
};

/* "cuda/ccudart.pxd":1718
 * cdef enum: cudaIpcMemLazyEnablePeerAccess = 0x01
 * 
 * cdef enum: cudaMemAttachGlobal = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachHost = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachGlobal = 0x01
};

/* "cuda/ccudart.pxd":1720
 * cdef enum: cudaMemAttachGlobal = 0x01
 * 
 * cdef enum: cudaMemAttachHost = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaMemAttachSingle = 0x04
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachHost = 0x02
};

/* "cuda/ccudart.pxd":1722
 * cdef enum: cudaMemAttachHost = 0x02
 * 
 * cdef enum: cudaMemAttachSingle = 0x04             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaOccupancyDefault = 0x00
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaMemAttachSingle = 0x04
};

/* "cuda/ccudart.pxd":1724
 * cdef enum: cudaMemAttachSingle = 0x04
 * 
 * cdef enum: cudaOccupancyDefault = 0x00             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaOccupancyDisableCachingOverride = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaOccupancyDefault = 0x00
};

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

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

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

/* "cuda/ccudart.pxd":1732
 * cdef enum: cudaInvalidDeviceId = -2
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaCooperativeLaunchMultiDeviceNoPreSync = 0x01
};

/* "cuda/ccudart.pxd":1734
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 0x01
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArraySparsePropertiesSingleMipTail = 0x1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaCooperativeLaunchMultiDeviceNoPostSync = 0x02
};

/* "cuda/ccudart.pxd":1736
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 0x02
 * 
 * cdef enum: cudaArraySparsePropertiesSingleMipTail = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaArraySparsePropertiesSingleMipTail = 0x1
};

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

/* "cuda/ccudart.pxd":1740
 * cdef enum: CUDA_IPC_HANDLE_SIZE = 64
 * 
 * cdef enum: cudaExternalMemoryDedicated = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalMemoryDedicated = 0x1
};

/* "cuda/ccudart.pxd":1742
 * cdef enum: cudaExternalMemoryDedicated = 0x1
 * 
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 0x01
};

/* "cuda/ccudart.pxd":1744
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 0x01
 * 
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaNvSciSyncAttrSignal = 0x1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 0x02
};

/* "cuda/ccudart.pxd":1746
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 0x02
 * 
 * cdef enum: cudaNvSciSyncAttrSignal = 0x1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaNvSciSyncAttrWait = 0x2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaNvSciSyncAttrSignal = 0x1
};

/* "cuda/ccudart.pxd":1748
 * cdef enum: cudaNvSciSyncAttrSignal = 0x1
 * 
 * cdef enum: cudaNvSciSyncAttrWait = 0x2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1D = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaNvSciSyncAttrWait = 0x2
};

/* "cuda/ccudart.pxd":1750
 * cdef enum: cudaNvSciSyncAttrWait = 0x2
 * 
 * cdef enum: cudaSurfaceType1D = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2D = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1D = 0x01
};

/* "cuda/ccudart.pxd":1752
 * cdef enum: cudaSurfaceType1D = 0x01
 * 
 * cdef enum: cudaSurfaceType2D = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType3D = 0x03
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType2D = 0x02
};

/* "cuda/ccudart.pxd":1754
 * cdef enum: cudaSurfaceType2D = 0x02
 * 
 * cdef enum: cudaSurfaceType3D = 0x03             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceTypeCubemap = 0x0C
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType3D = 0x03
};

/* "cuda/ccudart.pxd":1756
 * cdef enum: cudaSurfaceType3D = 0x03
 * 
 * cdef enum: cudaSurfaceTypeCubemap = 0x0C             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1DLayered = 0xF1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceTypeCubemap = 0x0C
};

/* "cuda/ccudart.pxd":1758
 * cdef enum: cudaSurfaceTypeCubemap = 0x0C
 * 
 * cdef enum: cudaSurfaceType1DLayered = 0xF1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2DLayered = 0xF2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1DLayered = 0xF1
};

/* "cuda/ccudart.pxd":1760
 * cdef enum: cudaSurfaceType1DLayered = 0xF1
 * 
 * cdef enum: cudaSurfaceType2DLayered = 0xF2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceTypeCubemapLayered = 0xFC
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType2DLayered = 0xF2
};

/* "cuda/ccudart.pxd":1762
 * cdef enum: cudaSurfaceType2DLayered = 0xF2
 * 
 * cdef enum: cudaSurfaceTypeCubemapLayered = 0xFC             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType1D = 0x01
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceTypeCubemapLayered = 0xFC
};

/* "cuda/ccudart.pxd":1764
 * cdef enum: cudaSurfaceTypeCubemapLayered = 0xFC
 * 
 * cdef enum: cudaTextureType1D = 0x01             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType2D = 0x02
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType1D = 0x01
};

/* "cuda/ccudart.pxd":1766
 * cdef enum: cudaTextureType1D = 0x01
 * 
 * cdef enum: cudaTextureType2D = 0x02             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType3D = 0x03
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType2D = 0x02
};

/* "cuda/ccudart.pxd":1768
 * cdef enum: cudaTextureType2D = 0x02
 * 
 * cdef enum: cudaTextureType3D = 0x03             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureTypeCubemap = 0x0C
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType3D = 0x03
};

/* "cuda/ccudart.pxd":1770
 * cdef enum: cudaTextureType3D = 0x03
 * 
 * cdef enum: cudaTextureTypeCubemap = 0x0C             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType1DLayered = 0xF1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureTypeCubemap = 0x0C
};

/* "cuda/ccudart.pxd":1772
 * cdef enum: cudaTextureTypeCubemap = 0x0C
 * 
 * cdef enum: cudaTextureType1DLayered = 0xF1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureType2DLayered = 0xF2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType1DLayered = 0xF1
};

/* "cuda/ccudart.pxd":1774
 * cdef enum: cudaTextureType1DLayered = 0xF1
 * 
 * cdef enum: cudaTextureType2DLayered = 0xF2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaTextureTypeCubemapLayered = 0xFC
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureType2DLayered = 0xF2
};

/* "cuda/ccudart.pxd":1776
 * cdef enum: cudaTextureType2DLayered = 0xF2
 * 
 * cdef enum: cudaTextureTypeCubemapLayered = 0xFC             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDART_VERSION = 11050
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaTextureTypeCubemapLayered = 0xFC
};

/* "cuda/ccudart.pxd":1778
 * cdef enum: cudaTextureTypeCubemapLayered = 0xFC
 * 
 * cdef enum: CUDART_VERSION = 11050             # <<<<<<<<<<<<<<
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDART_VERSION = 0x2B2A
};

/* "cuda/ccudart.pxd":15
 *     cudaRoundMinInf
 * 
 * cdef struct dim3:             # <<<<<<<<<<<<<<
 *     unsigned int x
 *     unsigned int y
 */
struct __pyx_t_4cuda_7ccudart_dim3 {
  unsigned int x;
  unsigned int y;
  unsigned int z;
};

/* "cuda/ccudart.pxd":178
 *     cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30
 * 
 * cdef struct cudaChannelFormatDesc:             # <<<<<<<<<<<<<<
 *     int x
 *     int y
 */
struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc {
  int x;
  int y;
  int z;
  int w;
  enum __pyx_t_4cuda_7ccudart_cudaChannelFormatKind f;
};

/* "cuda/ccudart.pxd":188
 *     cdef struct cudaArray:
 *         pass
 * ctypedef cudaArray* cudaArray_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct cudaArray *__pyx_t_4cuda_7ccudart_cudaArray_t;

/* "cuda/ccudart.pxd":193
 *     cdef struct cudaArray:
 *         pass
 * ctypedef cudaArray* cudaArray_const_t             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef struct cudaArray *__pyx_t_4cuda_7ccudart_cudaArray_const_t;

/* "cuda/ccudart.pxd":199
 *     cdef struct cudaMipmappedArray:
 *         pass
 * ctypedef cudaMipmappedArray* cudaMipmappedArray_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct cudaMipmappedArray *__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t;

/* "cuda/ccudart.pxd":204
 *     cdef struct cudaMipmappedArray:
 *         pass
 * ctypedef cudaMipmappedArray* cudaMipmappedArray_const_t             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef struct cudaMipmappedArray *__pyx_t_4cuda_7ccudart_cudaMipmappedArray_const_t;

/* "cuda/ccudart.pxd":207
 * 
 * 
 * cdef struct _cudaArraySparseProperties_tileExtent_s:             # <<<<<<<<<<<<<<
 *     unsigned int width
 *     unsigned int height
 */
struct __pyx_t_4cuda_7ccudart__cudaArraySparseProperties_tileExtent_s {
  unsigned int width;
  unsigned int height;
  unsigned int depth;
};

/* "cuda/ccudart.pxd":212
 *     unsigned int depth
 * 
 * cdef struct cudaArraySparseProperties:             # <<<<<<<<<<<<<<
 *     _cudaArraySparseProperties_tileExtent_s tileExtent
 *     unsigned int miptailFirstLevel
 */
struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties {
  struct __pyx_t_4cuda_7ccudart__cudaArraySparseProperties_tileExtent_s tileExtent;
  unsigned int miptailFirstLevel;
  unsigned PY_LONG_LONG miptailSize;
  unsigned int flags;
  unsigned int reserved[4];
};

/* "cuda/ccudart.pxd":232
 *     cudaMemcpyDefault = 4
 * 
 * cdef struct cudaPitchedPtr:             # <<<<<<<<<<<<<<
 *     void* ptr
 *     size_t pitch
 */
struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr {
  void *ptr;
  size_t pitch;
  size_t xsize;
  size_t ysize;
};

/* "cuda/ccudart.pxd":238
 *     size_t ysize
 * 
 * cdef struct cudaExtent:             # <<<<<<<<<<<<<<
 *     size_t width
 *     size_t height
 */
struct __pyx_t_4cuda_7ccudart_cudaExtent {
  size_t width;
  size_t height;
  size_t depth;
};

/* "cuda/ccudart.pxd":243
 *     size_t depth
 * 
 * cdef struct cudaPos:             # <<<<<<<<<<<<<<
 *     size_t x
 *     size_t y
 */
struct __pyx_t_4cuda_7ccudart_cudaPos {
  size_t x;
  size_t y;
  size_t z;
};

/* "cuda/ccudart.pxd":248
 *     size_t z
 * 
 * cdef struct cudaMemcpy3DParms:             # <<<<<<<<<<<<<<
 *     cudaArray_t srcArray
 *     cudaPos srcPos
 */
struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms {
  __pyx_t_4cuda_7ccudart_cudaArray_t srcArray;
  struct __pyx_t_4cuda_7ccudart_cudaPos srcPos;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr srcPtr;
  __pyx_t_4cuda_7ccudart_cudaArray_t dstArray;
  struct __pyx_t_4cuda_7ccudart_cudaPos dstPos;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr dstPtr;
  struct __pyx_t_4cuda_7ccudart_cudaExtent extent;
  enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind kind;
};

/* "cuda/ccudart.pxd":258
 *     cudaMemcpyKind kind
 * 
 * cdef struct cudaMemcpy3DPeerParms:             # <<<<<<<<<<<<<<
 *     cudaArray_t srcArray
 *     cudaPos srcPos
 */
struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms {
  __pyx_t_4cuda_7ccudart_cudaArray_t srcArray;
  struct __pyx_t_4cuda_7ccudart_cudaPos srcPos;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr srcPtr;
  int srcDevice;
  __pyx_t_4cuda_7ccudart_cudaArray_t dstArray;
  struct __pyx_t_4cuda_7ccudart_cudaPos dstPos;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr dstPtr;
  int dstDevice;
  struct __pyx_t_4cuda_7ccudart_cudaExtent extent;
};

/* "cuda/ccudart.pxd":269
 *     cudaExtent extent
 * 
 * cdef struct cudaMemsetParams:             # <<<<<<<<<<<<<<
 *     void* dst
 *     size_t pitch
 */
struct __pyx_t_4cuda_7ccudart_cudaMemsetParams {
  void *dst;
  size_t pitch;
  unsigned int value;
  unsigned int elementSize;
  size_t width;
  size_t height;
};

/* "cuda/ccudart.pxd":282
 *     cudaAccessPropertyPersisting = 2
 * 
 * cdef struct cudaAccessPolicyWindow:             # <<<<<<<<<<<<<<
 *     void* base_ptr
 *     size_t num_bytes
 */
struct __pyx_t_4cuda_7ccudart_cudaAccessPolicyWindow {
  void *base_ptr;
  size_t num_bytes;
  float hitRatio;
  enum __pyx_t_4cuda_7ccudart_cudaAccessProperty hitProp;
  enum __pyx_t_4cuda_7ccudart_cudaAccessProperty missProp;
};

/* "cuda/ccudart.pxd":289
 *     cudaAccessProperty missProp
 * 
 * ctypedef void (*cudaHostFn_t)(void* userData)             # <<<<<<<<<<<<<<
 * 
 * cdef struct cudaHostNodeParams:
 */
typedef void (*__pyx_t_4cuda_7ccudart_cudaHostFn_t)(void *);

/* "cuda/ccudart.pxd":291
 * ctypedef void (*cudaHostFn_t)(void* userData)
 * 
 * cdef struct cudaHostNodeParams:             # <<<<<<<<<<<<<<
 *     cudaHostFn_t fn
 *     void* userData
 */
struct __pyx_t_4cuda_7ccudart_cudaHostNodeParams {
  __pyx_t_4cuda_7ccudart_cudaHostFn_t fn;
  void *userData;
};

/* "cuda/ccudart.pxd":315
 *     cudaStreamAttributeSynchronizationPolicy = 3
 * 
 * cdef union cudaStreamAttrValue:             # <<<<<<<<<<<<<<
 *     cudaAccessPolicyWindow accessPolicyWindow
 *     cudaSynchronizationPolicy syncPolicy
 */
union __pyx_t_4cuda_7ccudart_cudaStreamAttrValue {
  struct __pyx_t_4cuda_7ccudart_cudaAccessPolicyWindow accessPolicyWindow;
  enum __pyx_t_4cuda_7ccudart_cudaSynchronizationPolicy syncPolicy;
};

/* "cuda/ccudart.pxd":354
 *     cudaKernelNodeAttributeCooperative = 2
 * 
 * cdef union cudaKernelNodeAttrValue:             # <<<<<<<<<<<<<<
 *     cudaAccessPolicyWindow accessPolicyWindow
 *     int cooperative
 */
union __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue {
  struct __pyx_t_4cuda_7ccudart_cudaAccessPolicyWindow accessPolicyWindow;
  int cooperative;
};

/* "cuda/ccudart.pxd":401
 *     cudaResViewFormatUnsignedBlockCompressed7 = 0x22
 * 
 * cdef struct _cudaResourceDesc_res_res_array_s:             # <<<<<<<<<<<<<<
 *     cudaArray_t array
 * 
 */
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_array_s {
  __pyx_t_4cuda_7ccudart_cudaArray_t array;
};

/* "cuda/ccudart.pxd":404
 *     cudaArray_t array
 * 
 * cdef struct _cudaResourceDesc_res_res_mipmap_s:             # <<<<<<<<<<<<<<
 *     cudaMipmappedArray_t mipmap
 * 
 */
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_mipmap_s {
  __pyx_t_4cuda_7ccudart_cudaMipmappedArray_t mipmap;
};

/* "cuda/ccudart.pxd":407
 *     cudaMipmappedArray_t mipmap
 * 
 * cdef struct _cudaResourceDesc_res_res_linear_s:             # <<<<<<<<<<<<<<
 *     void* devPtr
 *     cudaChannelFormatDesc desc
 */
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_linear_s {
  void *devPtr;
  struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc desc;
  size_t sizeInBytes;
};

/* "cuda/ccudart.pxd":412
 *     size_t sizeInBytes
 * 
 * cdef struct _cudaResourceDesc_res_res_pitch2D_s:             # <<<<<<<<<<<<<<
 *     void* devPtr
 *     cudaChannelFormatDesc desc
 */
struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_pitch2D_s {
  void *devPtr;
  struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc desc;
  size_t width;
  size_t height;
  size_t pitchInBytes;
};

/* "cuda/ccudart.pxd":419
 *     size_t pitchInBytes
 * 
 * cdef union _cudaResourceDesc_res_u:             # <<<<<<<<<<<<<<
 *     _cudaResourceDesc_res_res_array_s array
 *     _cudaResourceDesc_res_res_mipmap_s mipmap
 */
union __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_u {
  struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_array_s array;
  struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_mipmap_s mipmap;
  struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_linear_s linear;
  struct __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_res_pitch2D_s pitch2D;
};

/* "cuda/ccudart.pxd":425
 *     _cudaResourceDesc_res_res_pitch2D_s pitch2D
 * 
 * cdef struct cudaResourceDesc:             # <<<<<<<<<<<<<<
 *     cudaResourceType resType
 *     _cudaResourceDesc_res_u res
 */
struct __pyx_t_4cuda_7ccudart_cudaResourceDesc {
  enum __pyx_t_4cuda_7ccudart_cudaResourceType resType;
  union __pyx_t_4cuda_7ccudart__cudaResourceDesc_res_u res;
};

/* "cuda/ccudart.pxd":429
 *     _cudaResourceDesc_res_u res
 * 
 * cdef struct cudaResourceViewDesc:             # <<<<<<<<<<<<<<
 *     cudaResourceViewFormat format
 *     size_t width
 */
struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc {
  enum __pyx_t_4cuda_7ccudart_cudaResourceViewFormat format;
  size_t width;
  size_t height;
  size_t depth;
  unsigned int firstMipmapLevel;
  unsigned int lastMipmapLevel;
  unsigned int firstLayer;
  unsigned int lastLayer;
};

/* "cuda/ccudart.pxd":439
 *     unsigned int lastLayer
 * 
 * cdef struct cudaPointerAttributes:             # <<<<<<<<<<<<<<
 *     cudaMemoryType type
 *     int device
 */
struct __pyx_t_4cuda_7ccudart_cudaPointerAttributes {
  enum __pyx_t_4cuda_7ccudart_cudaMemoryType type;
  int device;
  void *devicePointer;
  void *hostPointer;
};

/* "cuda/ccudart.pxd":445
 *     void* hostPointer
 * 
 * cdef struct cudaFuncAttributes:             # <<<<<<<<<<<<<<
 *     size_t sharedSizeBytes
 *     size_t constSizeBytes
 */
struct __pyx_t_4cuda_7ccudart_cudaFuncAttributes {
  size_t sharedSizeBytes;
  size_t constSizeBytes;
  size_t localSizeBytes;
  int maxThreadsPerBlock;
  int numRegs;
  int ptxVersion;
  int binaryVersion;
  int cacheModeCA;
  int maxDynamicSharedSizeBytes;
  int preferredShmemCarveout;
};

/* "cuda/ccudart.pxd":657
 *     cudaMemLocationTypeDevice = 1
 * 
 * cdef struct cudaMemLocation:             # <<<<<<<<<<<<<<
 *     cudaMemLocationType type
 *     int id
 */
struct __pyx_t_4cuda_7ccudart_cudaMemLocation {
  enum __pyx_t_4cuda_7ccudart_cudaMemLocationType type;
  int id;
};

/* "cuda/ccudart.pxd":666
 *     cudaMemAccessFlagsProtReadWrite = 3
 * 
 * cdef struct cudaMemAccessDesc:             # <<<<<<<<<<<<<<
 *     cudaMemLocation location
 *     cudaMemAccessFlags flags
 */
struct __pyx_t_4cuda_7ccudart_cudaMemAccessDesc {
  struct __pyx_t_4cuda_7ccudart_cudaMemLocation location;
  enum __pyx_t_4cuda_7ccudart_cudaMemAccessFlags flags;
};

/* "cuda/ccudart.pxd":681
 *     cudaMemHandleTypeWin32Kmt = 0x4
 * 
 * cdef struct cudaMemPoolProps:             # <<<<<<<<<<<<<<
 *     cudaMemAllocationType allocType
 *     cudaMemAllocationHandleType handleTypes
 */
struct __pyx_t_4cuda_7ccudart_cudaMemPoolProps {
  enum __pyx_t_4cuda_7ccudart_cudaMemAllocationType allocType;
  enum __pyx_t_4cuda_7ccudart_cudaMemAllocationHandleType handleTypes;
  struct __pyx_t_4cuda_7ccudart_cudaMemLocation location;
  void *win32SecurityAttributes;
  unsigned char reserved[64];
};

/* "cuda/ccudart.pxd":688
 *     unsigned char reserved[64]
 * 
 * cdef struct cudaMemPoolPtrExportData:             # <<<<<<<<<<<<<<
 *     unsigned char reserved[64]
 * 
 */
struct __pyx_t_4cuda_7ccudart_cudaMemPoolPtrExportData {
  unsigned char reserved[64];
};

/* "cuda/ccudart.pxd":691
 *     unsigned char reserved[64]
 * 
 * cdef struct cudaMemAllocNodeParams:             # <<<<<<<<<<<<<<
 *     cudaMemPoolProps poolProps
 *     const cudaMemAccessDesc* accessDescs
 */
struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams {
  struct __pyx_t_4cuda_7ccudart_cudaMemPoolProps poolProps;
  struct __pyx_t_4cuda_7ccudart_cudaMemAccessDesc const *accessDescs;
  size_t accessDescCount;
  size_t bytesize;
  void *dptr;
};

/* "cuda/ccudart.pxd":710
 *     cudaDevP2PAttrCudaArrayAccessSupported = 4
 * 
 * cdef struct CUuuid_st:             # <<<<<<<<<<<<<<
 *     char bytes[16]
 * 
 */
struct __pyx_t_4cuda_7ccudart_CUuuid_st {
  char bytes[16];
};

/* "cuda/ccudart.pxd":713
 *     char bytes[16]
 * 
 * ctypedef CUuuid_st CUuuid             # <<<<<<<<<<<<<<
 * 
 * ctypedef CUuuid_st cudaUUID_t
 */
typedef struct __pyx_t_4cuda_7ccudart_CUuuid_st __pyx_t_4cuda_7ccudart_CUuuid;

/* "cuda/ccudart.pxd":715
 * ctypedef CUuuid_st CUuuid
 * 
 * ctypedef CUuuid_st cudaUUID_t             # <<<<<<<<<<<<<<
 * 
 * cdef struct cudaDeviceProp:
 */
typedef struct __pyx_t_4cuda_7ccudart_CUuuid_st __pyx_t_4cuda_7ccudart_cudaUUID_t;

/* "cuda/ccudart.pxd":717
 * ctypedef CUuuid_st cudaUUID_t
 * 
 * cdef struct cudaDeviceProp:             # <<<<<<<<<<<<<<
 *     char name[256]
 *     cudaUUID_t uuid
 */
struct __pyx_t_4cuda_7ccudart_cudaDeviceProp {
  char name[0x100];
  __pyx_t_4cuda_7ccudart_cudaUUID_t uuid;
  char luid[8];
  unsigned int luidDeviceNodeMask;
  size_t totalGlobalMem;
  size_t sharedMemPerBlock;
  int regsPerBlock;
  int warpSize;
  size_t memPitch;
  int maxThreadsPerBlock;
  int maxThreadsDim[3];
  int maxGridSize[3];
  int clockRate;
  size_t totalConstMem;
  int major;
  int minor;
  size_t textureAlignment;
  size_t texturePitchAlignment;
  int deviceOverlap;
  int multiProcessorCount;
  int kernelExecTimeoutEnabled;
  int integrated;
  int canMapHostMemory;
  int computeMode;
  int maxTexture1D;
  int maxTexture1DMipmap;
  int maxTexture1DLinear;
  int maxTexture2D[2];
  int maxTexture2DMipmap[2];
  int maxTexture2DLinear[3];
  int maxTexture2DGather[2];
  int maxTexture3D[3];
  int maxTexture3DAlt[3];
  int maxTextureCubemap;
  int maxTexture1DLayered[2];
  int maxTexture2DLayered[3];
  int maxTextureCubemapLayered[2];
  int maxSurface1D;
  int maxSurface2D[2];
  int maxSurface3D[3];
  int maxSurface1DLayered[2];
  int maxSurface2DLayered[3];
  int maxSurfaceCubemap;
  int maxSurfaceCubemapLayered[2];
  size_t surfaceAlignment;
  int concurrentKernels;
  int ECCEnabled;
  int pciBusID;
  int pciDeviceID;
  int pciDomainID;
  int tccDriver;
  int asyncEngineCount;
  int unifiedAddressing;
  int memoryClockRate;
  int memoryBusWidth;
  int l2CacheSize;
  int persistingL2CacheMaxSize;
  int maxThreadsPerMultiProcessor;
  int streamPrioritiesSupported;
  int globalL1CacheSupported;
  int localL1CacheSupported;
  size_t sharedMemPerMultiprocessor;
  int regsPerMultiprocessor;
  int managedMemory;
  int isMultiGpuBoard;
  int multiGpuBoardGroupID;
  int hostNativeAtomicSupported;
  int singleToDoublePrecisionPerfRatio;
  int pageableMemoryAccess;
  int concurrentManagedAccess;
  int computePreemptionSupported;
  int canUseHostPointerForRegisteredMem;
  int cooperativeLaunch;
  int cooperativeMultiDeviceLaunch;
  size_t sharedMemPerBlockOptin;
  int pageableMemoryAccessUsesHostPageTables;
  int directManagedMemAccessFromHost;
  int maxBlocksPerMultiProcessor;
  int accessPolicyMaxWindowSize;
  size_t reservedSharedMemPerBlock;
};

/* "cuda/ccudart.pxd":799
 *     size_t reservedSharedMemPerBlock
 * 
 * cdef struct cudaIpcEventHandle_st:             # <<<<<<<<<<<<<<
 *     char reserved[64]
 * 
 */
struct __pyx_t_4cuda_7ccudart_cudaIpcEventHandle_st {
  char reserved[64];
};

/* "cuda/ccudart.pxd":802
 *     char reserved[64]
 * 
 * ctypedef cudaIpcEventHandle_st cudaIpcEventHandle_t             # <<<<<<<<<<<<<<
 * 
 * cdef struct cudaIpcMemHandle_st:
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaIpcEventHandle_st __pyx_t_4cuda_7ccudart_cudaIpcEventHandle_t;

/* "cuda/ccudart.pxd":804
 * ctypedef cudaIpcEventHandle_st cudaIpcEventHandle_t
 * 
 * cdef struct cudaIpcMemHandle_st:             # <<<<<<<<<<<<<<
 *     char reserved[64]
 * 
 */
struct __pyx_t_4cuda_7ccudart_cudaIpcMemHandle_st {
  char reserved[64];
};

/* "cuda/ccudart.pxd":807
 *     char reserved[64]
 * 
 * ctypedef cudaIpcMemHandle_st cudaIpcMemHandle_t             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaExternalMemoryHandleType:
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaIpcMemHandle_st __pyx_t_4cuda_7ccudart_cudaIpcMemHandle_t;

/* "cuda/ccudart.pxd":819
 *     cudaExternalMemoryHandleTypeNvSciBuf = 8
 * 
 * cdef struct _cudaExternalMemoryHandleDesc_handle_handle_win32_s:             # <<<<<<<<<<<<<<
 *     void* handle
 *     void* name
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_handle_win32_s {
  void *handle;
  void *name;
};

/* "cuda/ccudart.pxd":823
 *     void* name
 * 
 * cdef union _cudaExternalMemoryHandleDesc_handle_u:             # <<<<<<<<<<<<<<
 *     int fd
 *     _cudaExternalMemoryHandleDesc_handle_handle_win32_s win32
 */
union __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_u {
  int fd;
  struct __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_handle_win32_s win32;
  void *nvSciBufObject;
};

/* "cuda/ccudart.pxd":828
 *     void* nvSciBufObject
 * 
 * cdef struct cudaExternalMemoryHandleDesc:             # <<<<<<<<<<<<<<
 *     cudaExternalMemoryHandleType type
 *     _cudaExternalMemoryHandleDesc_handle_u handle
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleDesc {
  enum __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleType type;
  union __pyx_t_4cuda_7ccudart__cudaExternalMemoryHandleDesc_handle_u handle;
  unsigned PY_LONG_LONG size;
  unsigned int flags;
};

/* "cuda/ccudart.pxd":834
 *     unsigned int flags
 * 
 * cdef struct cudaExternalMemoryBufferDesc:             # <<<<<<<<<<<<<<
 *     unsigned long long offset
 *     unsigned long long size
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryBufferDesc {
  unsigned PY_LONG_LONG offset;
  unsigned PY_LONG_LONG size;
  unsigned int flags;
};

/* "cuda/ccudart.pxd":839
 *     unsigned int flags
 * 
 * cdef struct cudaExternalMemoryMipmappedArrayDesc:             # <<<<<<<<<<<<<<
 *     unsigned long long offset
 *     cudaChannelFormatDesc formatDesc
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryMipmappedArrayDesc {
  unsigned PY_LONG_LONG offset;
  struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc formatDesc;
  struct __pyx_t_4cuda_7ccudart_cudaExtent extent;
  unsigned int flags;
  unsigned int numLevels;
};

/* "cuda/ccudart.pxd":858
 *     cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10
 * 
 * cdef struct _cudaExternalSemaphoreHandleDesc_handle_handle_win32_s:             # <<<<<<<<<<<<<<
 *     void* handle
 *     void* name
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_handle_win32_s {
  void *handle;
  void *name;
};

/* "cuda/ccudart.pxd":862
 *     void* name
 * 
 * cdef union _cudaExternalSemaphoreHandleDesc_handle_u:             # <<<<<<<<<<<<<<
 *     int fd
 *     _cudaExternalSemaphoreHandleDesc_handle_handle_win32_s win32
 */
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_u {
  int fd;
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_handle_win32_s win32;
  void *nvSciSyncObj;
};

/* "cuda/ccudart.pxd":867
 *     void* nvSciSyncObj
 * 
 * cdef struct cudaExternalSemaphoreHandleDesc:             # <<<<<<<<<<<<<<
 *     cudaExternalSemaphoreHandleType type
 *     _cudaExternalSemaphoreHandleDesc_handle_u handle
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleDesc {
  enum __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleType type;
  union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreHandleDesc_handle_u handle;
  unsigned int flags;
};

/* "cuda/ccudart.pxd":872
 *     unsigned int flags
 * 
 * cdef struct _cudaExternalSemaphoreSignalParams_params_params_fence_s:             # <<<<<<<<<<<<<<
 *     unsigned long long value
 * 
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_fence_s {
  unsigned PY_LONG_LONG value;
};

/* "cuda/ccudart.pxd":875
 *     unsigned long long value
 * 
 * cdef union _cudaExternalSemaphoreSignalParams_params_params_nvSciSync_u:             # <<<<<<<<<<<<<<
 *     void* fence
 *     unsigned long long reserved
 */
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_nvSciSync_u {
  void *fence;
  unsigned PY_LONG_LONG reserved;
};

/* "cuda/ccudart.pxd":879
 *     unsigned long long reserved
 * 
 * cdef struct _cudaExternalSemaphoreSignalParams_params_params_keyedMutex_s:             # <<<<<<<<<<<<<<
 *     unsigned long long key
 * 
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_keyedMutex_s {
  unsigned PY_LONG_LONG key;
};

/* "cuda/ccudart.pxd":882
 *     unsigned long long key
 * 
 * cdef struct _cudaExternalSemaphoreSignalParams_params_s:             # <<<<<<<<<<<<<<
 *     _cudaExternalSemaphoreSignalParams_params_params_fence_s fence
 *     _cudaExternalSemaphoreSignalParams_params_params_nvSciSync_u nvSciSync
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_s {
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_fence_s fence;
  union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_nvSciSync_u nvSciSync;
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_params_keyedMutex_s keyedMutex;
  unsigned int reserved[12];
};

/* "cuda/ccudart.pxd":888
 *     unsigned int reserved[12]
 * 
 * cdef struct cudaExternalSemaphoreSignalParams:             # <<<<<<<<<<<<<<
 *     _cudaExternalSemaphoreSignalParams_params_s params
 *     unsigned int flags
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalParams {
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreSignalParams_params_s params;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccudart.pxd":893
 *     unsigned int reserved[16]
 * 
 * cdef struct _cudaExternalSemaphoreWaitParams_params_params_fence_s:             # <<<<<<<<<<<<<<
 *     unsigned long long value
 * 
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_fence_s {
  unsigned PY_LONG_LONG value;
};

/* "cuda/ccudart.pxd":896
 *     unsigned long long value
 * 
 * cdef union _cudaExternalSemaphoreWaitParams_params_params_nvSciSync_u:             # <<<<<<<<<<<<<<
 *     void* fence
 *     unsigned long long reserved
 */
union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_nvSciSync_u {
  void *fence;
  unsigned PY_LONG_LONG reserved;
};

/* "cuda/ccudart.pxd":900
 *     unsigned long long reserved
 * 
 * cdef struct _cudaExternalSemaphoreWaitParams_params_params_keyedMutex_s:             # <<<<<<<<<<<<<<
 *     unsigned long long key
 *     unsigned int timeoutMs
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_keyedMutex_s {
  unsigned PY_LONG_LONG key;
  unsigned int timeoutMs;
};

/* "cuda/ccudart.pxd":904
 *     unsigned int timeoutMs
 * 
 * cdef struct _cudaExternalSemaphoreWaitParams_params_s:             # <<<<<<<<<<<<<<
 *     _cudaExternalSemaphoreWaitParams_params_params_fence_s fence
 *     _cudaExternalSemaphoreWaitParams_params_params_nvSciSync_u nvSciSync
 */
struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_s {
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_fence_s fence;
  union __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_nvSciSync_u nvSciSync;
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_params_keyedMutex_s keyedMutex;
  unsigned int reserved[10];
};

/* "cuda/ccudart.pxd":910
 *     unsigned int reserved[10]
 * 
 * cdef struct cudaExternalSemaphoreWaitParams:             # <<<<<<<<<<<<<<
 *     _cudaExternalSemaphoreWaitParams_params_s params
 *     unsigned int flags
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitParams {
  struct __pyx_t_4cuda_7ccudart__cudaExternalSemaphoreWaitParams_params_s params;
  unsigned int flags;
  unsigned int reserved[16];
};

/* "cuda/ccudart.pxd":915
 *     unsigned int reserved[16]
 * 
 * ctypedef cudaError cudaError_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaError __pyx_t_4cuda_7ccudart_cudaError_t;

/* "cuda/ccudart.pxd":920
 *     cdef struct CUstream_st:
 *         pass
 * ctypedef CUstream_st* cudaStream_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUstream_st *__pyx_t_4cuda_7ccudart_cudaStream_t;

/* "cuda/ccudart.pxd":925
 *     cdef struct CUevent_st:
 *         pass
 * ctypedef CUevent_st* cudaEvent_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUevent_st *__pyx_t_4cuda_7ccudart_cudaEvent_t;

/* "cuda/ccudart.pxd":930
 *     cdef struct cudaGraphicsResource:
 *         pass
 * ctypedef cudaGraphicsResource* cudaGraphicsResource_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaOutputMode cudaOutputMode_t
 */
typedef struct cudaGraphicsResource *__pyx_t_4cuda_7ccudart_cudaGraphicsResource_t;

/* "cuda/ccudart.pxd":932
 * ctypedef cudaGraphicsResource* cudaGraphicsResource_t
 * 
 * ctypedef cudaOutputMode cudaOutputMode_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaOutputMode __pyx_t_4cuda_7ccudart_cudaOutputMode_t;

/* "cuda/ccudart.pxd":937
 *     cdef struct CUexternalMemory_st:
 *         pass
 * ctypedef CUexternalMemory_st* cudaExternalMemory_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUexternalMemory_st *__pyx_t_4cuda_7ccudart_cudaExternalMemory_t;

/* "cuda/ccudart.pxd":942
 *     cdef struct CUexternalSemaphore_st:
 *         pass
 * ctypedef CUexternalSemaphore_st* cudaExternalSemaphore_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUexternalSemaphore_st *__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t;

/* "cuda/ccudart.pxd":947
 *     cdef struct CUgraph_st:
 *         pass
 * ctypedef CUgraph_st* cudaGraph_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUgraph_st *__pyx_t_4cuda_7ccudart_cudaGraph_t;

/* "cuda/ccudart.pxd":952
 *     cdef struct CUgraphNode_st:
 *         pass
 * ctypedef CUgraphNode_st* cudaGraphNode_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUgraphNode_st *__pyx_t_4cuda_7ccudart_cudaGraphNode_t;

/* "cuda/ccudart.pxd":957
 *     cdef struct CUuserObject_st:
 *         pass
 * ctypedef CUuserObject_st* cudaUserObject_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUuserObject_st *__pyx_t_4cuda_7ccudart_cudaUserObject_t;

/* "cuda/ccudart.pxd":962
 *     cdef struct CUfunc_st:
 *         pass
 * ctypedef CUfunc_st* cudaFunction_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef struct CUfunc_st *__pyx_t_4cuda_7ccudart_cudaFunction_t;

/* "cuda/ccudart.pxd":967
 *     cdef struct CUmemPoolHandle_st:
 *         pass
 * ctypedef CUmemPoolHandle_st* cudaMemPool_t             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaCGScope:
 */
typedef struct CUmemPoolHandle_st *__pyx_t_4cuda_7ccudart_cudaMemPool_t;

/* "cuda/ccudart.pxd":974
 *     cudaCGScopeMultiGrid = 2
 * 
 * cdef struct cudaKernelNodeParams:             # <<<<<<<<<<<<<<
 *     void* func
 *     dim3 gridDim
 */
struct __pyx_t_4cuda_7ccudart_cudaKernelNodeParams {
  void *func;
  struct __pyx_t_4cuda_7ccudart_dim3 gridDim;
  struct __pyx_t_4cuda_7ccudart_dim3 blockDim;
  unsigned int sharedMemBytes;
  void **kernelParams;
  void **extra;
};

/* "cuda/ccudart.pxd":982
 *     void** extra
 * 
 * cdef struct cudaExternalSemaphoreSignalNodeParams:             # <<<<<<<<<<<<<<
 *     cudaExternalSemaphore_t* extSemArray
 *     const cudaExternalSemaphoreSignalParams* paramsArray
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalNodeParams {
  __pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t *extSemArray;
  struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalParams const *paramsArray;
  unsigned int numExtSems;
};

/* "cuda/ccudart.pxd":987
 *     unsigned int numExtSems
 * 
 * cdef struct cudaExternalSemaphoreWaitNodeParams:             # <<<<<<<<<<<<<<
 *     cudaExternalSemaphore_t* extSemArray
 *     const cudaExternalSemaphoreWaitParams* paramsArray
 */
struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitNodeParams {
  __pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t *extSemArray;
  struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitParams const *paramsArray;
  unsigned int numExtSems;
};

/* "cuda/ccudart.pxd":1010
 *     cdef struct CUgraphExec_st:
 *         pass
 * ctypedef CUgraphExec_st* cudaGraphExec_t             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGraphExecUpdateResult:
 */
typedef struct CUgraphExec_st *__pyx_t_4cuda_7ccudart_cudaGraphExec_t;

/* "cuda/ccudart.pxd":1067
 *     cudaReadModeNormalizedFloat = 1
 * 
 * cdef struct cudaTextureDesc:             # <<<<<<<<<<<<<<
 *     cudaTextureAddressMode addressMode[3]
 *     cudaTextureFilterMode filterMode
 */
struct __pyx_t_4cuda_7ccudart_cudaTextureDesc {
  enum __pyx_t_4cuda_7ccudart_cudaTextureAddressMode addressMode[3];
  enum __pyx_t_4cuda_7ccudart_cudaTextureFilterMode filterMode;
  enum __pyx_t_4cuda_7ccudart_cudaTextureReadMode readMode;
  int sRGB;
  float borderColor[4];
  int normalizedCoords;
  unsigned int maxAnisotropy;
  enum __pyx_t_4cuda_7ccudart_cudaTextureFilterMode mipmapFilterMode;
  float mipmapLevelBias;
  float minMipmapLevelClamp;
  float maxMipmapLevelClamp;
  int disableTrilinearOptimization;
};

/* "cuda/ccudart.pxd":1113
 *     CUDA_C_64U = 27
 * 
 * ctypedef cudaDataType_t cudaDataType             # <<<<<<<<<<<<<<
 * 
 * cdef enum libraryPropertyType_t:
 */
typedef enum __pyx_t_4cuda_7ccudart_cudaDataType_t __pyx_t_4cuda_7ccudart_cudaDataType;

/* "cuda/ccudart.pxd":1120
 *     PATCH_LEVEL
 * 
 * ctypedef libraryPropertyType_t libraryPropertyType             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver
 */
typedef enum __pyx_t_4cuda_7ccudart_libraryPropertyType_t __pyx_t_4cuda_7ccudart_libraryPropertyType;

/* "cuda/ccudart.pxd":1226
 * cdef cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver
 * 
 * ctypedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void* userData)             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver
 */
typedef void (*__pyx_t_4cuda_7ccudart_cudaStreamCallback_t)(__pyx_t_4cuda_7ccudart_cudaStream_t, __pyx_t_4cuda_7ccudart_cudaError_t, void *);

/* "cuda/_lib/ccudart/utils.pxd":14
 * cimport cuda._cuda.ccuda as ccuda
 * 
 * cdef class cudaPythonGlobal:             # <<<<<<<<<<<<<<
 *     cdef bint _cudaPythonInit
 *     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 _cudaPythonInit;
  int _numDevices;
  __pyx_t_4cuda_5ccuda_CUdevice *_driverDevice;
  __pyx_t_4cuda_5ccuda_CUcontext *_driverContext;
  bool *_deviceInit;
  struct __pyx_t_4cuda_7ccudart_cudaDeviceProp *_deviceProperties;
  __pyx_t_4cuda_7ccudart_cudaError_t _lastError;
  int CUDART_VERSION;
};



struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal {
  __pyx_t_4cuda_7ccudart_cudaError_t (*lazyInit)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *);
  __pyx_t_4cuda_7ccudart_cudaError_t (*lazyInitDevice)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, int);
};
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 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
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, 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);

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* 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 __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_CUtexObject); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC *, __pyx_t_4cuda_5ccuda_CUtexObject); /*proto*/

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

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

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

/* Module declarations from 'libcpp' */

/* Module declarations from 'cuda._cuda.ccuda' */
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString)(__pyx_t_4cuda_5ccuda_CUresult, char const **); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion)(int *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet)(__pyx_t_4cuda_5ccuda_CUdevice *, int); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount)(int *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth)(size_t *, __pyx_t_4cuda_5ccuda_CUarray_format, unsigned int, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute)(int *, __pyx_t_4cuda_5ccuda_CUdevice_attribute, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2)(__pyx_t_4cuda_5ccuda_CUdevice, unsigned int); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState)(__pyx_t_4cuda_5ccuda_CUdevice, unsigned int *, int *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2)(__pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent)(__pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent)(__pyx_t_4cuda_5ccuda_CUcontext *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags)(unsigned int *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig)(__pyx_t_4cuda_5ccuda_CUsharedconfig); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId)(__pyx_t_4cuda_5ccuda_CUdevice *, char const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId)(char *, int, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer)(__pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, __pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, size_t); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync)(__pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, __pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, size_t, __pyx_t_4cuda_5ccuda_CUstream); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties)(__pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES *, __pyx_t_4cuda_5ccuda_CUarray); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties)(__pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES *, __pyx_t_4cuda_5ccuda_CUmipmappedArray); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2)(__pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR *, __pyx_t_4cuda_5ccuda_CUarray); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess)(__pyx_t_4cuda_5ccuda_CUmemoryPool, __pyx_t_4cuda_5ccuda_CUmemAccessDesc const *, size_t); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise)(__pyx_t_4cuda_5ccuda_CUdeviceptr, size_t, __pyx_t_4cuda_5ccuda_CUmem_advise, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute)(void *, size_t, __pyx_t_4cuda_5ccuda_CUmem_range_attribute, __pyx_t_4cuda_5ccuda_CUdeviceptr, size_t); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes)(void **, size_t *, __pyx_t_4cuda_5ccuda_CUmem_range_attribute *, size_t, __pyx_t_4cuda_5ccuda_CUdeviceptr, size_t); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes)(unsigned int, __pyx_t_4cuda_5ccuda_CUpointer_attribute *, void **, __pyx_t_4cuda_5ccuda_CUdeviceptr); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate)(__pyx_t_4cuda_5ccuda_CUstream *, unsigned int); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate)(__pyx_t_4cuda_5ccuda_CUevent *, unsigned int); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery)(__pyx_t_4cuda_5ccuda_CUevent); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory)(__pyx_t_4cuda_5ccuda_CUexternalMemory *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer)(__pyx_t_4cuda_5ccuda_CUdeviceptr *, __pyx_t_4cuda_5ccuda_CUexternalMemory, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray)(__pyx_t_4cuda_5ccuda_CUmipmappedArray *, __pyx_t_4cuda_5ccuda_CUexternalMemory, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore)(__pyx_t_4cuda_5ccuda_CUexternalSemaphore *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync)(__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, __pyx_t_4cuda_5ccuda_CUstream); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync)(__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, __pyx_t_4cuda_5ccuda_CUstream); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute)(int *, __pyx_t_4cuda_5ccuda_CUfunction_attribute, __pyx_t_4cuda_5ccuda_CUfunction); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams)(__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode)(__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D const *, __pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams)(__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams)(__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode)(__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS const *, __pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode)(__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams)(__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams)(__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUdeviceptr *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams)(__pyx_t_4cuda_5ccuda_CUgraphExec, __pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D const *, __pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams)(__pyx_t_4cuda_5ccuda_CUgraphExec, __pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS const *, __pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate)(__pyx_t_4cuda_5ccuda_CUtexObject *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC const *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC const *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_CUtexObject); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc)(__pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC *, __pyx_t_4cuda_5ccuda_CUtexObject); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate)(__pyx_t_4cuda_5ccuda_CUsurfObject *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC const *); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_CUsurfObject); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer)(int *, __pyx_t_4cuda_5ccuda_CUdevice, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess)(__pyx_t_4cuda_5ccuda_CUcontext, unsigned int); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess)(__pyx_t_4cuda_5ccuda_CUcontext); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute)(int *, __pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute, __pyx_t_4cuda_5ccuda_CUdevice, __pyx_t_4cuda_5ccuda_CUdevice); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress)(char const *, void **, int, __pyx_t_4cuda_5ccuda_cuuint64_t); /*proto*/
static __pyx_t_4cuda_5ccuda_CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable)(void const **, __pyx_t_4cuda_5ccuda_CUuuid const *); /*proto*/

/* Module declarations from 'cuda._lib.ccudart.utils' */
static PyTypeObject *__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = 0;
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *(*__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance)(void); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError)(__pyx_t_4cuda_7ccudart_cudaError_t); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo)(struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, int *, __pyx_t_4cuda_5ccuda_CUarray_format *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon)(__pyx_t_4cuda_7ccudart_cudaStream_t, __pyx_t_4cuda_7ccudart_cudaStreamCallback_t, void *, unsigned int); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon)(__pyx_t_4cuda_7ccudart_cudaStream_t, enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, __pyx_t_4cuda_7ccudart_cudaGraph_t *, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const **, size_t *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc)(struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *, size_t *, size_t *, size_t *, __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_v2 const *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc)(__pyx_t_4cuda_7ccudart_cudaArray_const_t, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc const *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC *, struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc const *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc)(struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC const *, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC const *, struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams)(void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms *); /*proto*/
static void (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams)(struct __pyx_t_4cuda_7ccudart_cudaMemsetParams const *, __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams)(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray)(__pyx_t_4cuda_7ccudart_cudaArray_t *, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, size_t, size_t, size_t, int, unsigned int); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray)(__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch)(void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost)(size_t, void **, unsigned int); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch)(size_t, size_t, size_t, void **, size_t *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray)(__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, size_t, size_t, size_t, unsigned int, unsigned int); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr)(char *, size_t, char const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D)(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *, bool, int, int, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch)(void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams)(__pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 const *, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms *); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray)(char *, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray)(__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr)(struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr, int, struct __pyx_t_4cuda_7ccudart_cudaExtent, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray)(__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, char const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray)(char *, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t, bool); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray)(__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind); /*proto*/
static __pyx_t_4cuda_7ccudart_cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc)(__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *); /*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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":22
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 23, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

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

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

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreate(__pyx_t_4cuda_7ccudart_cudaStream_t *__pyx_v_pStream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":34
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate(__pyx_v_pStream, 0); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreate(__pyx_t_4cuda_7ccudart_cudaEvent_t *__pyx_v_event) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":46
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate(__pyx_v_event, __pyx_e_4cuda_5ccuda_CU_EVENT_DEFAULT); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 47, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventQuery(__pyx_t_4cuda_7ccudart_cudaEvent_t __pyx_v_event) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  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(((__pyx_t_4cuda_5ccuda_CUevent)__pyx_v_event)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 55, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_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 != __pyx_e_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaChannelFormatKind __pyx_v_f) {
  struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc __pyx_v_desc;
  struct __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDriverGetVersion(int *__pyx_v_driverVersion) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_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 != __pyx_e_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaRuntimeGetVersion(int *__pyx_v_runtimeVersion) {
  __pyx_t_4cuda_7ccudart_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 = __pyx_e_4cuda_7ccudart_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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetTexture1DLinearMaxWidth(size_t *__pyx_v_maxWidthInElements, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *__pyx_v_fmtDesc, int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUarray_format __pyx_v_fmt;
  int __pyx_v_numChannels;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":88
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_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.lazyInit()
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":94
 *     cdef int numChannels = 0
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":96
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo(__pyx_v_fmtDesc, (&__pyx_v_numChannels), (&__pyx_v_fmt));

  /* "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 == __pyx_e_4cuda_7ccudart_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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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_2 = __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_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 101, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "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 != __pyx_e_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocHost(void **__pyx_v_ptr, size_t __pyx_v_size) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":110
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":115
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost(__pyx_v_size, __pyx_v_ptr, 0);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_7ccudart_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 = __pyx_e_4cuda_7ccudart_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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":129
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch(__pyx_v_width, __pyx_v_height, 1, __pyx_v_devPtr, __pyx_v_pitch);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __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 != __pyx_e_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocMipmappedArray(__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *__pyx_v_mipmappedArray, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *__pyx_v_desc, struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_extent, unsigned int __pyx_v_numLevels, unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_7ccudart_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 = __pyx_e_4cuda_7ccudart_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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":143
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __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 != __pyx_e_4cuda_7ccudart_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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":155
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 156, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":167
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 168, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":179
 *     err = m_global.lazyInit()
 *     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.lazyInit()
 *     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)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, __pyx_v_stream);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 180, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

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

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

    /* "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 = __pyx_e_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode(__pyx_t_4cuda_7ccudart_cudaGraphNode_t *__pyx_v_pGraphNode, __pyx_t_4cuda_7ccudart_cudaGraph_t __pyx_v_graph, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *__pyx_v_pCopyParams) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":193
 *     if pCopyParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":198
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 198, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":203
 *         return err
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pCopyParams, (&__pyx_v_driverNodeParams));

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":206
 *     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":204
 * 
 *     err = toDriverMemCopy3DParams(pCopyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":208
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __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_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":211
 *     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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":214
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode1D(__pyx_t_4cuda_7ccudart_cudaGraphNode_t *__pyx_v_pGraphNode, __pyx_t_4cuda_7ccudart_cudaGraph_t __pyx_v_graph, __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms __pyx_v_copyParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemcpyNode1D", __pyx_f[0], 214, 1, __PYX_ERR(0, 214, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":220
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":223
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 223, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":228
 *         return err
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)));

  /* "cuda/_lib/ccudart/ccudart.pyx":230
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":232
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":233
 *     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":231
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":235
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __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_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 235, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":214
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":241
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams1D(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms __pyx_v_copyParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeSetParams1D", __pyx_f[0], 241, 1, __PYX_ERR(0, 241, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":246
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":249
 *     if err != cudaSuccess:
 *         return err
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)));

  /* "cuda/_lib/ccudart/ccudart.pyx":251
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":253
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":254
 *     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":252
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":241
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":262
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams(__pyx_t_4cuda_7ccudart_cudaGraphExec_t __pyx_v_hGraphExec, __pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *__pyx_v_pNodeParams) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemcpyNodeSetParams", __pyx_f[0], 262, 1, __PYX_ERR(0, 262, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":267
 *     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":268
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":271
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":274
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 274, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":279
 *         return err
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":281
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":282
 *     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":280
 * 
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":262
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":290
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams1D(__pyx_t_4cuda_7ccudart_cudaGraphExec_t __pyx_v_hGraphExec, __pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms __pyx_v_copyParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemcpyNodeSetParams1D", __pyx_f[0], 290, 1, __PYX_ERR(0, 290, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":296
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":299
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 299, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":302
 *     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":300
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":304
 *         return err
 * 
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)             # <<<<<<<<<<<<<<
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 */
  (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(__pyx_v_dst, __pyx_v_src, __pyx_v_count, __pyx_v_kind, (&__pyx_v_copyParams)));

  /* "cuda/_lib/ccudart/ccudart.pyx":306
 *     copy1DConvertTo3DParams(dst, src, count, kind, &copyParams)
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&__pyx_v_copyParams), (&__pyx_v_driverNodeParams));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":308
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":309
 *     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":307
 * 
 *     err = toDriverMemCopy3DParams(&copyParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":290
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":317
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_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) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDriverEntryPoint", __pyx_f[0], 317, 1, __PYX_ERR(0, 317, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":319
 * 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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":320
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":321
 *     err = <cudaError_t>ccuda._cuGetProcAddress(symbol, funcPtr, m_global.CUDART_VERSION, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":320
 *     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":322
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":317
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":325
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemsetNode(__pyx_t_4cuda_7ccudart_cudaGraphNode_t *__pyx_v_pGraphNode, __pyx_t_4cuda_7ccudart_cudaGraph_t __pyx_v_graph, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct __pyx_t_4cuda_7ccudart_cudaMemsetParams const *__pyx_v_pMemsetParams) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS __pyx_v_driverParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemsetNode", __pyx_f[0], 325, 1, __PYX_ERR(0, 325, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":330
 *     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":331
 * 
 *     if pMemsetParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":334
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":337
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 337, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":342
 *         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":344
 *     toDriverMemsetNodeParams(pMemsetParams, &driverParams)
 * 
 *     err = <cudaError_t>ccuda._cuGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, &driverParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __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_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 344, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":325
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":350
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemsetNodeSetParams(__pyx_t_4cuda_7ccudart_cudaGraphExec_t __pyx_v_hGraphExec, __pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaMemsetParams const *__pyx_v_pNodeParams) {
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS __pyx_v_driverParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphExecMemsetNodeSetParams", __pyx_f[0], 350, 1, __PYX_ERR(0, 350, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":355
 *     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":356
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":359
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":362
 *     if err != cudaSuccess:
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 362, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":367
 *         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":369
 *     toDriverMemsetNodeParams(pNodeParams, &driverParams)
 * 
 *     err = <cudaError_t>ccuda._cuGraphExecMemsetNodeSetParams(hGraphExec, node, &driverParams, context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams(__pyx_v_hGraphExec, __pyx_v_node, (&__pyx_v_driverParams), __pyx_v_context); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 369, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":350
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *__pyx_v_pNodeParams) {
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeSetParams", __pyx_f[0], 375, 1, __PYX_ERR(0, 375, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":379
 *     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":380
 * 
 *     if pNodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":383
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":385
 *     err = m_global.lazyInit()
 *     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":384
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":386
 *     if err != cudaSuccess:
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":388
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeSetParams(node, &driverNodeParams)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":389
 *     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":387
 *         return err
 *     err = toDriverMemCopy3DParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":375
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeGetParams(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms *__pyx_v_p) {
  __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 __pyx_v_driverNodeParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemcpyNodeGetParams", __pyx_f[0], 396, 1, __PYX_ERR(0, 396, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":399
 *     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":400
 * 
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":404
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":406
 *     err = m_global.lazyInit()
 *     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":405
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 */
  }

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":409
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":410
 *     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":408
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemcpyNodeGetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":411
 *         _setLastError(err)
 *         return err
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams((&__pyx_v_driverNodeParams), __pyx_v_p);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 411, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_3;

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

    /* "cuda/_lib/ccudart/ccudart.pyx":413
 *     err = toCudartMemCopy3DParams(&driverNodeParams, p)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":396
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":419
 * cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

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

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":423
 *         return err
 *     if NULL == attr:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef int bytes
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":426
 *         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 __pyx_t_4cuda_7ccudart_cudaFuncAttributes))));

  /* "cuda/_lib/ccudart/ccudart.pyx":427
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).maxThreadsPerBlock), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":428
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":429
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":430
 *     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":428
 *     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":431
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).numRegs), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_NUM_REGS, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 431, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":432
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":433
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":434
 *     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":432
 *         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":435
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).ptxVersion), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_PTX_VERSION, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":436
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":437
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":438
 *     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":436
 *         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":439
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).binaryVersion), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_BINARY_VERSION, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 439, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":440
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":441
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":442
 *     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":440
 *         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":443
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 443, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":444
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":445
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":446
 *     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":444
 *         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":447
 *         _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":448
 *         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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 448, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":449
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":450
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":451
 *     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":449
 *     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":452
 *         _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":453
 *         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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 453, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":454
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":455
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":456
 *     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":454
 *     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":457
 *         _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":458
 *         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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).cacheModeCA), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 458, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":459
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":460
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":461
 *     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":459
 *     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":462
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&__pyx_v_bytes), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 462, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":463
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":464
 *     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)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":465
 *     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":463
 *         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":466
 *         _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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute((&(__pyx_v_attr[0]).preferredShmemCarveout), __pyx_e_4cuda_5ccuda_CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, ((__pyx_t_4cuda_5ccuda_CUfunction)__pyx_v_func)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 466, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":467
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":468
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":469
 *     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":467
 *         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":470
 *         _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":471
 *         return err
 *     attr[0].maxDynamicSharedSizeBytes = <size_t>bytes
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

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

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

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

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":476
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocArray(__pyx_t_4cuda_7ccudart_cudaArray_t *__pyx_v_arrayPtr, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *__pyx_v_desc, size_t __pyx_v_width, size_t __pyx_v_height, unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMallocArray", __pyx_f[0], 476, 1, __PYX_ERR(0, 476, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":477
 * 
 * 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":478
 * 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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":477
 * 
 * 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":481
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":483
 *     err = m_global.lazyInit()
 *     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":482
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":484
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocArray(arrayPtr, desc, 0, height, width, 0, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 484, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_3;

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":476
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3D(struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr *__pyx_v_pitchedDevPtr, struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_extent) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_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], 490, 1, __PYX_ERR(0, 490, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":491
 * 
 * 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":492
 * cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if pitchedDevPtr == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":495
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":496
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":497
 *     err = m_global.lazyInit()
 *     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":496
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":498
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocPitch(extent.width, extent.height, extent.depth, &pitchedDevPtr[0].ptr, &pitchedDevPtr[0].pitch)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __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));
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 498, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":499
 *         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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":500
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":501
 *     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":499
 *         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":502
 *         _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":503
 *         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":504
 *     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":490
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":507
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3DArray(__pyx_t_4cuda_7ccudart_cudaArray_t *__pyx_v_arrayPtr, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *__pyx_v_desc, struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_extent, unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMalloc3DArray", __pyx_f[0], 507, 1, __PYX_ERR(0, 507, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":508
 * 
 * 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":509
 * 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
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":508
 * 
 * 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":513
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":515
 *     err = m_global.lazyInit()
 *     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":514
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":516
 *     if err != cudaSuccess:
 *         return err
 *     err = mallocArray(arrayPtr, desc, extent.depth, extent.height, extent.width, 0, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 516, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":517
 *         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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":517
 *         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":519
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":507
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":522
 * 
 * 
 * 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(__pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_error) {
  char const *__pyx_v_pStr;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  char const *__pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetErrorString", __pyx_f[0], 522, 1, __PYX_ERR(0, 522, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":523
 * 
 * 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":526
 *     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(((__pyx_t_4cuda_5ccuda_CUresult)__pyx_v_error), (&__pyx_v_pStr)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 526, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":527
 * 
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":528
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     if err == <cudaError_t>cudaErrorInvalidValue:
 *         pStr = "unrecognized error code"
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":530
 *         _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":529
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     if err == <cudaError_t>cudaErrorInvalidValue:             # <<<<<<<<<<<<<<
 *         pStr = "unrecognized error code"
 *     return pStr
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":522
 * 
 * 
 * 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":534
 * 
 * 
 * cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

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

  /* "cuda/_lib/ccudart/ccudart.pyx":537
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":539
 *     err = m_global.lazyInit()
 *     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":538
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":540
 *     if err != cudaSuccess:
 *         return err
 *     err = streamAddCallbackCommon(stream, callback, userData, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon(__pyx_v_stream, __pyx_v_callback, __pyx_v_userData, __pyx_v_flags);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 540, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":534
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":549
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":551
 *     err = m_global.lazyInit()
 *     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":550
 * 
 *     err = m_global.lazyInit()
 *     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":552
 *     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)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon(__pyx_v_stream, __pyx_v_captureStatus_out, __pyx_v_id_out, ((__pyx_t_4cuda_7ccudart_cudaGraph_t *)0), ((__pyx_t_4cuda_7ccudart_cudaGraphNode_t const **)0), ((size_t *)0));
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 552, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":553
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":553
 *         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":555
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":546
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":558
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo_v2(__pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream, enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureStatus *__pyx_v_captureStatus_out, unsigned PY_LONG_LONG *__pyx_v_id_out, __pyx_t_4cuda_7ccudart_cudaGraph_t *__pyx_v_graph_out, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const **__pyx_v_dependencies_out, size_t *__pyx_v_numDependencies_out) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaStreamGetCaptureInfo_v2", __pyx_f[0], 558, 1, __PYX_ERR(0, 558, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":561
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":562
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":563
 *     err = m_global.lazyInit()
 *     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":562
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":564
 *     if err != cudaSuccess:
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 564, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":565
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":566
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":565
 *         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":567
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":558
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":570
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalSemaphore(__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t *__pyx_v_extSem_out, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleDesc const *__pyx_v_semHandleDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC __pyx_v_driverSemHandleDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  void *__pyx_t_3;
  unsigned int __pyx_t_4;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaImportExternalSemaphore", __pyx_f[0], 570, 1, __PYX_ERR(0, 570, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":574
 *     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":575
 * 
 *     if semHandleDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":576
 *     if semHandleDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":574
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 *     if semHandleDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":578
 *         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":580
 *     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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":581
 * 
 *     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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":582
 *     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_2 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":580
 *     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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":584
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":585
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":586
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":583
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":588
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":589
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":590
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":587
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeD3D12Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":592
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":593
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":594
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":591
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeD3D11Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":596
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":597
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":598
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":595
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeNvSciSync:

    /* "cuda/_lib/ccudart/ccudart.pyx":600
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC;

    /* "cuda/_lib/ccudart/ccudart.pyx":601
 *     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_3 = __pyx_v_semHandleDesc->handle.nvSciSyncObj;
    __pyx_v_driverSemHandleDesc.handle.nvSciSyncObj = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":599
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeKeyedMutex:

    /* "cuda/_lib/ccudart/ccudart.pyx":603
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX;

    /* "cuda/_lib/ccudart/ccudart.pyx":604
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":605
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":602
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeKeyedMutexKmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":607
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":608
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":609
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":606
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":611
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":612
 *     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_2 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":610
 *         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 __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":614
 *         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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":615
 *     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_3 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":616
 *         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_3 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":613
 *         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":617
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     driverSemHandleDesc.flags = semHandleDesc.flags             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
  __pyx_t_4 = __pyx_v_semHandleDesc->flags;
  __pyx_v_driverSemHandleDesc.flags = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":619
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":620
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":621
 *     err = m_global.lazyInit()
 *     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":620
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":622
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore(((__pyx_t_4cuda_5ccuda_CUexternalSemaphore *)__pyx_v_extSem_out), (&__pyx_v_driverSemHandleDesc)); if (unlikely(__pyx_t_5 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 622, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":623
 *         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 != ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_e_4cuda_7ccudart_cudaSuccess)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":624
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":623
 *         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":625
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":570
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":628
 * 
 * 
 * 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.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync(__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSignalExternalSemaphoresAsync", __pyx_f[0], 628, 1, __PYX_ERR(0, 628, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":630
 * 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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":631
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":632
 *     err = m_global.lazyInit()
 *     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":631
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     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":633
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync(((__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *)__pyx_v_extSemArray), ((__pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 633, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":634
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":635
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":634
 *         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":637
 *         _setLastError(err)
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":628
 * 
 * 
 * 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.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":640
 * 
 * 
 * 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.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync(__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaWaitExternalSemaphoresAsync", __pyx_f[0], 640, 1, __PYX_ERR(0, 640, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":642
 * 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.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":643
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":644
 *     err = m_global.lazyInit()
 *     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":643
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     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":645
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync(((__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *)__pyx_v_extSemArray), ((__pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 645, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":646
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":647
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":646
 *         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":649
 *         _setLastError(err)
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":640
 * 
 * 
 * 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.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":652
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo(struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *__pyx_v_desc, struct __pyx_t_4cuda_7ccudart_cudaExtent *__pyx_v_extent, unsigned int *__pyx_v_flags, __pyx_t_4cuda_7ccudart_cudaArray_t __pyx_v_array) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_driverDesc;
  size_t __pyx_v_width;
  size_t __pyx_v_height;
  size_t __pyx_v_depth;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  unsigned int __pyx_t_3;
  __pyx_t_4cuda_7ccudart_cudaError_t __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], 652, 1, __PYX_ERR(0, 652, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":655
 *     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":656
 *     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":657
 *     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":660
 * 
 *     # 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":661
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:
 *         flags[0] = 0             # <<<<<<<<<<<<<<
 * 
 *     if desc:
 */
    (__pyx_v_flags[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":660
 * 
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = 0
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":663
 *         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":664
 * 
 *     if desc:
 *         memset(desc, 0, sizeof(desc[0]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (void)(memset(__pyx_v_desc, 0, (sizeof((__pyx_v_desc[0])))));

    /* "cuda/_lib/ccudart/ccudart.pyx":663
 *         flags[0] = 0
 * 
 *     if desc:             # <<<<<<<<<<<<<<
 *         memset(desc, 0, sizeof(desc[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":667
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  __pyx_t_1 = (__pyx_v_extent != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":668
 * 
 *     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":667
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":670
 *         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), ((__pyx_t_4cuda_5ccuda_CUarray)__pyx_v_array)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 670, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":671
 * 
 *     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 != ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_e_4cuda_7ccudart_cudaSuccess)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":672
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":673
 *     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":671
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":676
 * 
 *     # 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":677
 *     # 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_3 = __pyx_v_driverDesc.Flags;
    (__pyx_v_flags[0]) = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":676
 * 
 *     # Flags are copied directly from the driver API
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = driverDesc.Flags
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":681
 *     # 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":682
 *     # indicates a 2D array.
 *     if desc:
 *         width  = 0             # <<<<<<<<<<<<<<
 *         height = 0
 *         depth  = 0
 */
    __pyx_v_width = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":683
 *     if desc:
 *         width  = 0
 *         height = 0             # <<<<<<<<<<<<<<
 *         depth  = 0
 * 
 */
    __pyx_v_height = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":684
 *         width  = 0
 *         height = 0
 *         depth  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 */
    __pyx_v_depth = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":686
 *         depth  = 0
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)             # <<<<<<<<<<<<<<
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)
 */
    try {
      __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc(__pyx_v_desc, (&__pyx_v_depth), (&__pyx_v_height), (&__pyx_v_width), (&__pyx_v_driverDesc));
    } catch(...) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      __Pyx_CppExn2PyErr();
      #ifdef WITH_THREAD
      __Pyx_PyGILState_Release(__pyx_gilstate_save);
      #endif
      __PYX_ERR(0, 686, __pyx_L1_error)
    }
    __pyx_v_err = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":687
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = ((__pyx_v_err != ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_e_4cuda_7ccudart_cudaSuccess)) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":688
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

      /* "cuda/_lib/ccudart/ccudart.pyx":687
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":681
 *     # 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":691
 *             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":692
 * 
 *     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":693
 *     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":694
 *         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":691
 *             return err
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":696
 *         extent.depth  = driverDesc.Depth
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":652
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":699
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray(__pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DToArray", __pyx_f[0], 699, 1, __PYX_ERR(0, 699, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":702
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":703
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":704
 *     err = m_global.lazyInit()
 *     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":703
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":705
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 705, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":706
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":707
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":706
 *         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":708
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":699
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":711
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray(void *__pyx_v_dst, size_t __pyx_v_dpitch, __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DFromArray", __pyx_f[0], 711, 1, __PYX_ERR(0, 711, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":714
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":715
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":716
 *     err = m_global.lazyInit()
 *     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":715
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":717
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 717, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":718
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":719
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":718
 *         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":720
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":711
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":723
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray(__pyx_t_4cuda_7ccudart_cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DArrayToArray", __pyx_f[0], 723, 1, __PYX_ERR(0, 723, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":726
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":727
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":728
 *     err = m_global.lazyInit()
 *     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":727
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":729
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 729, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":730
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":731
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":730
 *         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":732
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":723
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":735
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync(__pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DToArrayAsync", __pyx_f[0], 735, 1, __PYX_ERR(0, 735, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":738
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":739
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":740
 *     err = m_global.lazyInit()
 *     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":739
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":741
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 741, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":742
 *         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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":743
 *     err = memcpy2DToArray(dst, hOffset, wOffset, <const char*>src, spitch, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":742
 *         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":744
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":735
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":747
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync(void *__pyx_v_dst, size_t __pyx_v_dpitch, __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy2DFromArrayAsync", __pyx_f[0], 747, 1, __PYX_ERR(0, 747, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":750
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":751
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":752
 *     err = m_global.lazyInit()
 *     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":751
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":753
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 753, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":754
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":755
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":754
 *         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":756
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":747
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":759
 * 
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D(struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_extent) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemset3D", __pyx_f[0], 759, 1, __PYX_ERR(0, 759, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":762
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":763
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":764
 *     err = m_global.lazyInit()
 *     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":763
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":765
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, NULL, 0);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 765, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":766
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":767
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":766
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":759
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":771
 * 
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync(struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_extent, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemset3DAsync", __pyx_f[0], 771, 1, __PYX_ERR(0, 771, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":774
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":775
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":776
 *     err = m_global.lazyInit()
 *     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":775
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":777
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, __pyx_v_stream, 1);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 777, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":778
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":779
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":778
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":771
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":783
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray(__pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyToArray", __pyx_f[0], 783, 1, __PYX_ERR(0, 783, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":786
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":787
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":788
 *     err = m_global.lazyInit()
 *     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":787
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":789
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 789, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":790
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":791
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":790
 *         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":792
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":783
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":795
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray(void *__pyx_v_dst, __pyx_t_4cuda_7ccudart_cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyFromArray", __pyx_f[0], 795, 1, __PYX_ERR(0, 795, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":798
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":799
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":800
 *     err = m_global.lazyInit()
 *     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":799
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":801
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 801, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":802
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":803
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":802
 *         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":804
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":795
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":807
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync(__pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyToArrayAsync", __pyx_f[0], 807, 1, __PYX_ERR(0, 807, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":810
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":811
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":812
 *     err = m_global.lazyInit()
 *     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":811
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":813
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 813, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":814
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":815
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":814
 *         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":816
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":807
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":819
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync(void *__pyx_v_dst, __pyx_t_4cuda_7ccudart_cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyFromArrayAsync", __pyx_f[0], 819, 1, __PYX_ERR(0, 819, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":822
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":823
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":824
 *     err = m_global.lazyInit()
 *     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":823
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":825
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 825, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":826
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":827
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":826
 *         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":828
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":819
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":831
 * 
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaPointerAttributes attrib
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes(struct __pyx_t_4cuda_7ccudart_cudaPointerAttributes *__pyx_v_attributes, void const *__pyx_v_ptr) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_7ccudart_cudaPointerAttributes __pyx_v_attrib;
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_driverContext;
  __pyx_t_4cuda_5ccuda_CUmemorytype __pyx_v_driverMemoryType;
  int __pyx_v_isManaged;
  __pyx_t_4cuda_5ccuda_CUpointer_attribute __pyx_v_query[6];
  void **__pyx_v_data;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  void *__pyx_t_1[6];
  int __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaPointerGetAttributes", __pyx_f[0], 831, 1, __PYX_ERR(0, 831, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":834
 *     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":838
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_CONTEXT;

  /* "cuda/_lib/ccudart/ccudart.pyx":839
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_MEMORY_TYPE;

  /* "cuda/_lib/ccudart/ccudart.pyx":840
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_DEVICE_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":841
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_HOST_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":842
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_IS_MANAGED;

  /* "cuda/_lib/ccudart/ccudart.pyx":843
 *     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]) = __pyx_e_4cuda_5ccuda_CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL;

  /* "cuda/_lib/ccudart/ccudart.pyx":845
 *     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":854
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_attributes == NULL) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":855
 * 
 *     if attributes == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":856
 *     if attributes == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # Get all the attributes we need
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":854
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":859
 * 
 *     # 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_3 = (sizeof(__pyx_v_query));
  __pyx_t_4 = (sizeof((__pyx_v_query[0])));
  if (unlikely(__pyx_t_4 == 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, 859, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes(((unsigned int)(((double)__pyx_t_3) / ((double)__pyx_t_4))), __pyx_v_query, __pyx_v_data, ((__pyx_t_4cuda_5ccuda_CUdeviceptr_v2)__pyx_v_ptr)); if (unlikely(__pyx_t_5 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 859, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":860
 *     # 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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":861
 *     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":862
 *     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":863
 *         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":861
 *     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":864
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":865
 *             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":860
 *     # 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":867
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
  switch (__pyx_v_driverMemoryType) {
    case __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_HOST:

    /* "cuda/_lib/ccudart/ccudart.pyx":868
 * 
 *     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":869
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 */
      __pyx_v_attrib.type = __pyx_e_4cuda_7ccudart_cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":868
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":871
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeHost             # <<<<<<<<<<<<<<
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 */
    /*else*/ {
      __pyx_v_attrib.type = __pyx_e_4cuda_7ccudart_cudaMemoryTypeHost;
    }
    __pyx_L6:;

    /* "cuda/_lib/ccudart/ccudart.pyx":867
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_MEMORYTYPE_DEVICE:

    /* "cuda/_lib/ccudart/ccudart.pyx":873
 *             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":874
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeDevice
 */
      __pyx_v_attrib.type = __pyx_e_4cuda_7ccudart_cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":873
 *             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":876
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeDevice             # <<<<<<<<<<<<<<
 *     else:
 *          if driverMemoryType == 0:
 */
    /*else*/ {
      __pyx_v_attrib.type = __pyx_e_4cuda_7ccudart_cudaMemoryTypeDevice;
    }
    __pyx_L7:;

    /* "cuda/_lib/ccudart/ccudart.pyx":872
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    default:

    /* "cuda/_lib/ccudart/ccudart.pyx":878
 *             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":879
 *     else:
 *          if driverMemoryType == 0:
 *             attrib.type = cudaMemoryTypeUnregistered             # <<<<<<<<<<<<<<
 *          else:
 *             if attributes != NULL:
 */
      __pyx_v_attrib.type = __pyx_e_4cuda_7ccudart_cudaMemoryTypeUnregistered;

      /* "cuda/_lib/ccudart/ccudart.pyx":878
 *             attrib.type = cudaMemoryTypeDevice
 *     else:
 *          if driverMemoryType == 0:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 */
      goto __pyx_L8;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":881
 *             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":882
 *          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":883
 *             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":881
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 *             if attributes != NULL:             # <<<<<<<<<<<<<<
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 */
      }

      /* "cuda/_lib/ccudart/ccudart.pyx":884
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 * 
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

      /* "cuda/_lib/ccudart/ccudart.pyx":885
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # copy to user structure
 */
      __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
      goto __pyx_L0;
    }
    __pyx_L8:;
    break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":888
 * 
 *     # copy to user structure
 *     attributes[0] = attrib             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (__pyx_v_attributes[0]) = __pyx_v_attrib;

  /* "cuda/_lib/ccudart/ccudart.pyx":890
 *     attributes[0] = attrib
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":831
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":893
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceFlags(unsigned int *__pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_driverContext;
  __pyx_t_4cuda_5ccuda_CUdevice __pyx_v_dev;
  unsigned int __pyx_v_pcFlags;
  int __pyx_v_pcActive;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceFlags", __pyx_f[0], 893, 1, __PYX_ERR(0, 893, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":895
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":896
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":897
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     if flags == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":896
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":899
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_flags == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":900
 * 
 *     if flags == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":901
 *     if flags == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext driverContext
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":899
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":904
 * 
 *     cdef ccuda.CUcontext driverContext
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_driverContext)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 904, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":906
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":907
 *     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":905
 *     cdef ccuda.CUcontext driverContext
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":910
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_driverContext != NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":911
 *     # Get the flags from the current context
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags(__pyx_v_flags); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 911, __pyx_L1_error)
    __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

    /* "cuda/_lib/ccudart/ccudart.pyx":912
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":913
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

      /* "cuda/_lib/ccudart/ccudart.pyx":912
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":914
 *         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":910
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":920
 *     cdef unsigned int pcFlags
 *     cdef int pcActive
 *     err = <cudaError_t>ccuda._cuDeviceGet(&dev, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet((&__pyx_v_dev), 0); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 920, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":921
 *     cdef int pcActive
 *     err = <cudaError_t>ccuda._cuDeviceGet(&dev, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":922
 *     err = <cudaError_t>ccuda._cuDeviceGet(&dev, 0)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":923
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":921
 *     cdef int pcActive
 *     err = <cudaError_t>ccuda._cuDeviceGet(&dev, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":924
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState(__pyx_v_dev, (&__pyx_v_pcFlags), (&__pyx_v_pcActive)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 924, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":925
 *         return err
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":926
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":927
 *     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":925
 *         return err
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(dev, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":928
 *         _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":929
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":893
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":932
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3D(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *__pyx_v_p) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3D", __pyx_f[0], 932, 1, __PYX_ERR(0, 932, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":933
 * 
 * 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":934
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":933
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":937
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":938
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":939
 *     err = m_global.lazyInit()
 *     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":938
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":940
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, NULL, 0);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 940, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":941
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":942
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":941
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":932
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":946
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *__pyx_v_p, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DAsync", __pyx_f[0], 946, 1, __PYX_ERR(0, 946, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":947
 * 
 * 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":948
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":947
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":951
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":952
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":953
 *     err = m_global.lazyInit()
 *     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":952
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":954
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, __pyx_v_stream, 1);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 954, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":955
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":956
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":955
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":946
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":960
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess(__pyx_t_4cuda_7ccudart_cudaMemPool_t __pyx_v_memPool, struct __pyx_t_4cuda_7ccudart_cudaMemAccessDesc const *__pyx_v_descList, size_t __pyx_v_count) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  size_t __pyx_v_MAX_DEVICES;
  __pyx_t_4cuda_5ccuda_CUmemAccessDesc __pyx_v_localList[32];
  __pyx_t_4cuda_5ccuda_CUmemAccessDesc *__pyx_v_cuDescList;
  size_t __pyx_v_i;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemPoolSetAccess", __pyx_f[0], 960, 1, __PYX_ERR(0, 960, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":962
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":963
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":964
 *     err = m_global.lazyInit()
 *     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":963
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":965
 *     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":968
 *     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":970
 *     cdef size_t i = 0
 * 
 *     if (count > MAX_DEVICES):             # <<<<<<<<<<<<<<
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_count > __pyx_v_MAX_DEVICES) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":971
 * 
 *     if (count > MAX_DEVICES):
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)             # <<<<<<<<<<<<<<
 *     else:
 *         cuDescList = localList
 */
    __pyx_v_cuDescList = ((__pyx_t_4cuda_5ccuda_CUmemAccessDesc *)calloc((sizeof(__pyx_t_4cuda_5ccuda_CUmemAccessDesc)), __pyx_v_count));

    /* "cuda/_lib/ccudart/ccudart.pyx":970
 *     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":973
 *         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":975
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  __pyx_t_1 = ((__pyx_v_cuDescList == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":976
 * 
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorMemoryAllocation));

    /* "cuda/_lib/ccudart/ccudart.pyx":977
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     while i < count:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":975
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":979
 *         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_1 = ((__pyx_v_i < __pyx_v_count) != 0);
    if (!__pyx_t_1) break;

    /* "cuda/_lib/ccudart/ccudart.pyx":980
 * 
 *     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 = ((__pyx_t_4cuda_5ccuda_CUmemLocationType)(__pyx_v_descList[__pyx_v_i]).location.type);

    /* "cuda/_lib/ccudart/ccudart.pyx":981
 *     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_2 = (__pyx_v_descList[__pyx_v_i]).location.id;
    (__pyx_v_cuDescList[__pyx_v_i]).location.id = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":982
 *         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 = ((__pyx_t_4cuda_5ccuda_CUmemAccess_flags)(__pyx_v_descList[__pyx_v_i]).flags);

    /* "cuda/_lib/ccudart/ccudart.pyx":983
 *         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":985
 *         i += 1
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess(__pyx_v_memPool, __pyx_v_cuDescList, __pyx_v_count); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 985, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":986
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":987
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":986
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":990
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  __pyx_t_1 = ((__pyx_v_count > __pyx_v_MAX_DEVICES) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":991
 * 
 *     if count > MAX_DEVICES:
 *         free(cuDescList)             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    free(__pyx_v_cuDescList);

    /* "cuda/_lib/ccudart/ccudart.pyx":990
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":993
 *         free(cuDescList)
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":960
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":996
 * 
 * 
 * cdef cudaError_t _cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceReset(void) {
  int __pyx_v_deviceOrdinal;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceReset", __pyx_f[0], 996, 1, __PYX_ERR(0, 996, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":997
 * 
 * cdef cudaError_t _cudaDeviceReset() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if not m_global._cudaPythonInit:
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":999
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 *     if not m_global._cudaPythonInit:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     err = m_global.lazyInit()
 */
  __pyx_t_1 = ((!(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_cudaPythonInit != 0)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1000
 *     cdef cudaError_t err
 *     if not m_global._cudaPythonInit:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":999
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 *     if not m_global._cudaPythonInit:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     err = m_global.lazyInit()
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1001
 *     if not m_global._cudaPythonInit:
 *         return cudaSuccess
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1002
 *         return cudaSuccess
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUcontext context
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1002
 *         return cudaSuccess
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUcontext context
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1005
 *         return err
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1005, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1007
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1008
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1009
 *         _setLastError(err)
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])
 */
  __pyx_t_3 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1010
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])
 *             break
 */
    __pyx_t_1 = (((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_deviceOrdinal]) == __pyx_v_context) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1011
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])             # <<<<<<<<<<<<<<
 *             break
 *     return err
 */
      __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverDevice[__pyx_v_deviceOrdinal])); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

      /* "cuda/_lib/ccudart/ccudart.pyx":1012
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])
 *             break             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      goto __pyx_L7_break;

      /* "cuda/_lib/ccudart/ccudart.pyx":1010
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])
 *             break
 */
    }
  }
  __pyx_L7_break:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1013
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxReset_v2(m_global._driverDevice[deviceOrdinal])
 *             break
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":996
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1016
 * 
 * 
 * cdef cudaError_t _cudaThreadExit() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaDeviceReset()
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaThreadExit(void) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaThreadExit", __pyx_f[0], 1016, 1, __PYX_ERR(0, 1016, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1017
 * 
 * cdef cudaError_t _cudaThreadExit() nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaDeviceReset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaDeviceReset(); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1017, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1016
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1020
 * 
 * 
 * cdef cudaError_t _cudaGetLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetLastError(void) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_last_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetLastError", __pyx_f[0], 1020, 1, __PYX_ERR(0, 1020, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1021
 * 
 * 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":1022
 * 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 = __pyx_e_4cuda_7ccudart_cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1023
 *     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":1020
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1026
 * 
 * 
 * cdef cudaError_t _cudaPeekAtLastError() nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return m_global._lastError
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPeekAtLastError(void) {
  __pyx_t_4cuda_7ccudart_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], 1026, 1, __PYX_ERR(0, 1026, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1027
 * 
 * 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":1026
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1030
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDevice(int *__pyx_v_device) {
  int __pyx_v_deviceOrdinal;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_v_err_driver;
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  int __pyx_v_found;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_4;
  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("_cudaGetDevice", __pyx_f[0], 1030, 1, __PYX_ERR(0, 1030, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1031
 * 
 * cdef cudaError_t _cudaGetDevice(int* device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUresult err_driver
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1035
 *     cdef ccuda.CUresult err_driver
 *     cdef ccuda.CUcontext context
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1036
 *     cdef ccuda.CUcontext context
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1036
 *     cdef ccuda.CUcontext context
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1039
 *         return err
 * 
 *     err_driver = ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):
 *         err = cudaSetDevice(0)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1039, __pyx_L1_error)
  __pyx_v_err_driver = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1040
 * 
 *     err_driver = ccuda._cuCtxGetCurrent(&context)
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):             # <<<<<<<<<<<<<<
 *         err = cudaSetDevice(0)
 *         if err != cudaSuccess:
 */
  __pyx_t_3 = ((__pyx_v_err_driver == __pyx_e_4cuda_5ccuda_CUDA_ERROR_INVALID_CONTEXT) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_err_driver == __pyx_e_4cuda_5ccuda_CUDA_SUCCESS) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_context == NULL) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1041
 *     err_driver = ccuda._cuCtxGetCurrent(&context)
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):
 *         err = cudaSetDevice(0)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_4 = __pyx_f_4cuda_7ccudart_cudaSetDevice(0); if (unlikely(__pyx_t_4 == ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1041, __pyx_L1_error)
    __pyx_v_err = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1042
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):
 *         err = cudaSetDevice(0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1043
 *         err = cudaSetDevice(0)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err_driver = ccuda._cuCtxGetCurrent(&context)
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

      /* "cuda/_lib/ccudart/ccudart.pyx":1044
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err_driver = ccuda._cuCtxGetCurrent(&context)
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1042
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):
 *         err = cudaSetDevice(0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1045
 *             _setLastError(err)
 *             return err
 *         err_driver = ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 * 
 *     if err_driver != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1045, __pyx_L1_error)
    __pyx_v_err_driver = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":1040
 * 
 *     err_driver = ccuda._cuCtxGetCurrent(&context)
 *     if err_driver == ccuda.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT or (err_driver == ccuda.cudaError_enum.CUDA_SUCCESS and context == NULL):             # <<<<<<<<<<<<<<
 *         err = cudaSetDevice(0)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1047
 *         err_driver = ccuda._cuCtxGetCurrent(&context)
 * 
 *     if err_driver != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err_driver != __pyx_e_4cuda_5ccuda_CUDA_SUCCESS) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1048
 * 
 *     if err_driver != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1049
 *     if err_driver != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     found = False
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1047
 *         err_driver = ccuda._cuCtxGetCurrent(&context)
 * 
 *     if err_driver != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1051
 *         return err
 * 
 *     found = False             # <<<<<<<<<<<<<<
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 */
  __pyx_v_found = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1052
 * 
 *     found = False
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             found = True
 */
  __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":1053
 *     found = False
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             found = True
 *             break
 */
    __pyx_t_1 = (((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_deviceOrdinal]) == __pyx_v_context) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1054
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             found = True             # <<<<<<<<<<<<<<
 *             break
 *     device[0] = deviceOrdinal if found else 0
 */
      __pyx_v_found = 1;

      /* "cuda/_lib/ccudart/ccudart.pyx":1055
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             found = True
 *             break             # <<<<<<<<<<<<<<
 *     device[0] = deviceOrdinal if found else 0
 *     return cudaSuccess
 */
      goto __pyx_L11_break;

      /* "cuda/_lib/ccudart/ccudart.pyx":1053
 *     found = False
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             found = True
 *             break
 */
    }
  }
  __pyx_L11_break:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1056
 *             found = True
 *             break
 *     device[0] = deviceOrdinal if found else 0             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  if ((__pyx_v_found != 0)) {
    __pyx_t_5 = __pyx_v_deviceOrdinal;
  } else {
    __pyx_t_5 = 0;
  }
  (__pyx_v_device[0]) = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1057
 *             break
 *     device[0] = deviceOrdinal if found else 0
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1030
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* device) 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._cudaGetDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1060
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDevice(int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDevice", __pyx_f[0], 1060, 1, __PYX_ERR(0, 1060, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1062
 * cdef cudaError_t _cudaSetDevice(int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1063
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if device < 0 or device >= m_global._numDevices:
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1064
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if device < 0 or device >= m_global._numDevices:
 *         _setLastError(err)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1063
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if device < 0 or device >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1065
 *     if err != cudaSuccess:
 *         return err
 *     if device < 0 or device >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = ((__pyx_v_device < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_device >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1066
 *         return err
 *     if device < 0 or device >= m_global._numDevices:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1067
 *     if device < 0 or device >= m_global._numDevices:
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitDevice(device)
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1065
 *     if err != cudaSuccess:
 *         return err
 *     if device < 0 or device >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1069
 *         return cudaErrorInvalidDevice
 * 
 *     err = m_global.lazyInitDevice(device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_device);

  /* "cuda/_lib/ccudart/ccudart.pyx":1070
 * 
 *     err = m_global.lazyInitDevice(device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1071
 *     err = m_global.lazyInitDevice(device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1072
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(m_global._driverContext[device])
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1070
 * 
 *     err = m_global.lazyInitDevice(device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1074
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(m_global._driverContext[device])             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_device])); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1074, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1075
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(m_global._driverContext[device])
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1076
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(m_global._driverContext[device])
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1075
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(m_global._driverContext[device])
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1060
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1080
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceProperties(struct __pyx_t_4cuda_7ccudart_cudaDeviceProp *__pyx_v_prop, int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceProperties", __pyx_f[0], 1080, 1, __PYX_ERR(0, 1080, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1082
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1083
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1084
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>device)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1083
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1086
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_prop[0]).kernelExecTimeoutEnabled), __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1086, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1087
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1088
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1089
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, <ccuda.CUdevice>device)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1087
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1091
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_prop[0]).computeMode), __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1091, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1092
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1093
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1094
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>device)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1092
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1096
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_prop[0]).clockRate), __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_CLOCK_RATE, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1096, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1097
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1098
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1099
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>device)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1097
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1101
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_prop[0]).memoryClockRate), __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1101, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1102
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1103
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1104
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>device)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1102
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1106
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_prop[0]).singleToDoublePrecisionPerfRatio), __pyx_e_4cuda_5ccuda_CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1106, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1107
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1108
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1109
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     prop[0] = m_global._deviceProperties[device]
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1107
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(prop[0].singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1111
 *         return err
 * 
 *     prop[0] = m_global._deviceProperties[device]             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (__pyx_v_prop[0]) = (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_device]);

  /* "cuda/_lib/ccudart/ccudart.pyx":1113
 *     prop[0] = m_global._deviceProperties[device]
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1080
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1116
 * 
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice(int *__pyx_v_device, struct __pyx_t_4cuda_7ccudart_cudaDeviceProp const *__pyx_v_prop) {
  __pyx_t_4cuda_7ccudart_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;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char __pyx_t_3[1];
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaChooseDevice", __pyx_f[0], 1116, 1, __PYX_ERR(0, 1116, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1117
 * 
 * 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":1118
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1119
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1117
 * 
 * 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":1122
 * 
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1123
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1124
 *     err = m_global.lazyInit()
 *     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":1123
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1125
 *     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":1126
 *         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":1128
 *     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_3[0] = '\x00';
  __pyx_v_dontCare_name = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1129
 *     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":1130
 *     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":1131
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 * 
 */
  __pyx_v_dontCare_totalGlobalMem = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1132
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 * 
 *     for deviceOrdinal in range(m_global._numDevices):
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1134
 *     cdef int deviceOrdinal = 0
 * 
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 */
  __pyx_t_4 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":1135
 * 
 *     for deviceOrdinal in range(m_global._numDevices):
 *         rank = 0             # <<<<<<<<<<<<<<
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0
 */
    __pyx_v_rank = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1136
 *     for deviceOrdinal in range(m_global._numDevices):
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].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":1137
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0             # <<<<<<<<<<<<<<
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 */
      __pyx_v_rank = (__pyx_v_rank + (strncmp((__pyx_v_prop[0]).name, (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_deviceOrdinal]).name, (sizeof((__pyx_v_prop[0]).name))) == 0));

      /* "cuda/_lib/ccudart/ccudart.pyx":1136
 *     for deviceOrdinal in range(m_global._numDevices):
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1138
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].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":1139
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major             # <<<<<<<<<<<<<<
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).major <= (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_deviceOrdinal]).major));

      /* "cuda/_lib/ccudart/ccudart.pyx":1138
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, m_global._deviceProperties[deviceOrdinal].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1140
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    __pyx_t_2 = (((__pyx_v_prop[0]).major == (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_deviceOrdinal]).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":1141
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor             # <<<<<<<<<<<<<<
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].totalGlobalMem
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).minor <= (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_deviceOrdinal]).minor));

      /* "cuda/_lib/ccudart/ccudart.pyx":1140
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= m_global._deviceProperties[deviceOrdinal].major
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1142
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].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":1143
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].totalGlobalMem             # <<<<<<<<<<<<<<
 *         if (rank > maxrank):
 *             maxrank = rank
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).totalGlobalMem <= (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceProperties[__pyx_v_deviceOrdinal]).totalGlobalMem));

      /* "cuda/_lib/ccudart/ccudart.pyx":1142
 *         if (prop[0].major == m_global._deviceProperties[deviceOrdinal].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= m_global._deviceProperties[deviceOrdinal].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].totalGlobalMem
 *         if (rank > maxrank):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1144
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].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":1145
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].totalGlobalMem
 *         if (rank > maxrank):
 *             maxrank = rank             # <<<<<<<<<<<<<<
 *             best = deviceOrdinal
 * 
 */
      __pyx_v_maxrank = __pyx_v_rank;

      /* "cuda/_lib/ccudart/ccudart.pyx":1146
 *         if (rank > maxrank):
 *             maxrank = rank
 *             best = deviceOrdinal             # <<<<<<<<<<<<<<
 * 
 *     device[0] = best
 */
      __pyx_v_best = __pyx_v_deviceOrdinal;

      /* "cuda/_lib/ccudart/ccudart.pyx":1144
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= m_global._deviceProperties[deviceOrdinal].totalGlobalMem
 *         if (rank > maxrank):             # <<<<<<<<<<<<<<
 *             maxrank = rank
 *             best = deviceOrdinal
 */
    }
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1148
 *             best = deviceOrdinal
 * 
 *     device[0] = best             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_device[0]) = __pyx_v_best;

  /* "cuda/_lib/ccudart/ccudart.pyx":1149
 * 
 *     device[0] = best
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1116
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1152
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray(__pyx_t_4cuda_7ccudart_cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, __pyx_t_4cuda_7ccudart_cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind __pyx_v_kind) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyArrayToArray", __pyx_f[0], 1152, 1, __PYX_ERR(0, 1152, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1155
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1156
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1157
 *     err = m_global.lazyInit()
 *     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":1156
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1158
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1158, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1159
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1160
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1159
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1152
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1164
 * 
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc(struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *__pyx_v_desc, __pyx_t_4cuda_7ccudart_cudaArray_const_t __pyx_v_array) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetChannelDesc", __pyx_f[0], 1164, 1, __PYX_ERR(0, 1164, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1167
 *     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":1168
 * 
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1169
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1171
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1172
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1173
 *     err = m_global.lazyInit()
 *     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":1172
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1174
 *     if err != cudaSuccess:
 *         return err
 *     err = getChannelDesc(array, desc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc(__pyx_v_array, __pyx_v_desc);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1174, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1175
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1176
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1175
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1164
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1180
 * 
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject(__pyx_t_4cuda_7ccudart_cudaTextureObject_t *__pyx_v_pTexObject, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *__pyx_v_pResDesc, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc const *__pyx_v_pTexDesc, struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc const *__pyx_v_pResViewDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v_rd;
  __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC __pyx_v_td;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateTextureObject", __pyx_f[0], 1180, 1, __PYX_ERR(0, 1180, __pyx_L1_error));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1184
 * 
 *     if pResDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1185
 *     if pResDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUDA_RESOURCE_DESC rd
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1191
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1193
 *     err = m_global.lazyInit()
 *     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":1192
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1194
 *     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":1195
 *         return err
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)             # <<<<<<<<<<<<<<
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 */
    try {
      __pyx_t_2 = __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);
    } catch(...) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      __Pyx_CppExn2PyErr();
      #ifdef WITH_THREAD
      __Pyx_PyGILState_Release(__pyx_gilstate_save);
      #endif
      __PYX_ERR(0, 1195, __pyx_L1_error)
    }
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":1194
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 *     else:
 */
    goto __pyx_L5;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1197
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, &rvd, pResViewDesc)
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    try {
      __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), __pyx_v_pTexDesc, NULL, __pyx_v_pResViewDesc);
    } catch(...) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      __Pyx_CppExn2PyErr();
      #ifdef WITH_THREAD
      __Pyx_PyGILState_Release(__pyx_gilstate_save);
      #endif
      __PYX_ERR(0, 1197, __pyx_L1_error)
    }
    __pyx_v_err = __pyx_t_2;
  }
  __pyx_L5:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1198
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1199
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1200
 *     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":1198
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, pTexDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1201
 *         _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":1202
 *         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_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), (&__pyx_v_rvd)); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1202, __pyx_L1_error)
    __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/ccudart.pyx":1201
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1204
 *         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_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), NULL); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1204, __pyx_L1_error)
    __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);
  }
  __pyx_L7:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1205
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1206
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1205
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1207
 *     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":1180
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1209
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc(struct __pyx_t_4cuda_7ccudart_cudaTextureDesc *__pyx_v_pTexDesc, __pyx_t_4cuda_7ccudart_cudaTextureObject_t __pyx_v_texObject) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_7ccudart_cudaResourceDesc __pyx_v_resDesc;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v_rd;
  __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC __pyx_v_td;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectTextureDesc", __pyx_f[0], 1209, 1, __PYX_ERR(0, 1209, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1216
 *     cdef ccuda.CUDA_TEXTURE_DESC td
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1217
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1218
 *     err = m_global.lazyInit()
 *     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":1217
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1219
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1219, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1220
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1221
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1222
 *     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":1220
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1223
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc((&__pyx_v_td), __pyx_v_texObject); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1223, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1224
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1225
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1226
 *     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":1224
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1227
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), __pyx_v_pTexDesc, (&__pyx_v_td), NULL, NULL);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1227, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1228
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1229
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1228
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, pTexDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1232
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1209
 *     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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1235
 * 
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaResourceDesc resDesc
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc(struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc *__pyx_v_pResViewDesc, __pyx_t_4cuda_7ccudart_cudaTextureObject_t __pyx_v_texObject) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_7ccudart_cudaResourceDesc __pyx_v_resDesc;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v_rd;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectResourceViewDesc", __pyx_f[0], 1235, 1, __PYX_ERR(0, 1235, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1241
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1242
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1243
 *     err = m_global.lazyInit()
 *     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":1242
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1244
 *     if err != cudaSuccess:
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1244, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1245
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1246
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1247
 *     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":1245
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1248
 *         _setLastError(err)
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc((&__pyx_v_rvd), __pyx_v_texObject); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1248, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1249
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1250
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1251
 *     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":1249
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1252
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), NULL, NULL, __pyx_v_pResViewDesc, (&__pyx_v_rvd));
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1252, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1253
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1254
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1253
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1257
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1235
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1260
 * 
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, cudaUUID_t* pExportTableId) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable(void const **__pyx_v_ppExportTable, __pyx_t_4cuda_7ccudart_cudaUUID_t *__pyx_v_pExportTableId) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetExportTable", __pyx_f[0], 1260, 1, __PYX_ERR(0, 1260, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1263
 *     cdef cudaError_t err
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1264
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1265
 *     err = m_global.lazyInit()
 *     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":1264
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1266
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable(__pyx_v_ppExportTable, ((__pyx_t_4cuda_5ccuda_CUuuid *)__pyx_v_pExportTableId)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1266, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1267
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1268
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1267
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1260
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1272
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms const *__pyx_v_p) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms __pyx_v_cp;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaArray_t __pyx_t_2;
  struct __pyx_t_4cuda_7ccudart_cudaPos __pyx_t_3;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr __pyx_t_4;
  struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_t_5;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DPeer", __pyx_f[0], 1272, 1, __PYX_ERR(0, 1272, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1273
 * 
 * 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":1274
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1273
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1279
 *     cdef cudaError_t err
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1281
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1282
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1283
 *     err = m_global.lazyInit()
 *     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":1282
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1284
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_2 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1285
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1286
 *     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_4 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1287
 *     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_2 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1288
 *     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_3 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1289
 *     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_4 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1290
 *     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]).extent;
  __pyx_v_cp.extent = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1291
 *     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 = __pyx_e_4cuda_7ccudart_cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1293
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_6 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D((&__pyx_v_cp), 1, (__pyx_v_p[0]).srcDevice, (__pyx_v_p[0]).dstDevice, NULL, 0);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1293, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1294
 * 
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1295
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1294
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1296
 *     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":1272
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1298
 *     return err
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync(struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms const *__pyx_v_p, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms __pyx_v_cp;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_7ccudart_cudaArray_t __pyx_t_2;
  struct __pyx_t_4cuda_7ccudart_cudaPos __pyx_t_3;
  struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr __pyx_t_4;
  struct __pyx_t_4cuda_7ccudart_cudaExtent __pyx_t_5;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpy3DPeerAsync", __pyx_f[0], 1298, 1, __PYX_ERR(0, 1298, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1299
 * 
 * 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":1300
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1299
 * 
 * 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":1305
 *     cdef cudaError_t err
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1307
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1308
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1309
 *     err = m_global.lazyInit()
 *     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":1308
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1310
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_2 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1311
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1312
 *     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_4 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1313
 *     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_2 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1314
 *     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_3 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1315
 *     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_4 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1316
 *     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]).extent;
  __pyx_v_cp.extent = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1317
 *     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 = __pyx_e_4cuda_7ccudart_cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1319
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_6 = __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);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1319, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1320
 * 
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1321
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1320
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1298
 *     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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1325
 * 
 * 
 * cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d
 */

static struct __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaPitchedPtr __pyx_v_s;
  struct __pyx_t_4cuda_7ccudart_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], 1325, 1, __PYX_ERR(0, 1325, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1327
 * 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":1328
 *     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":1329
 *     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":1330
 *     s.pitch = p
 *     s.xsize = xsz
 *     s.ysize = ysz             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
  __pyx_v_s.ysize = __pyx_v_ysz;

  /* "cuda/_lib/ccudart/ccudart.pyx":1331
 *     s.xsize = xsz
 *     s.ysize = ysz
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1325
 * 
 * 
 * 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":1334
 * 
 * 
 * cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPos p
 *     p.x = x
 */

static struct __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaPos __pyx_v_p;
  struct __pyx_t_4cuda_7ccudart_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], 1334, 1, __PYX_ERR(0, 1334, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1336
 * 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":1337
 *     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":1338
 *     p.x = x
 *     p.y = y
 *     p.z = z             # <<<<<<<<<<<<<<
 *     return p
 * 
 */
  __pyx_v_p.z = __pyx_v_z;

  /* "cuda/_lib/ccudart/ccudart.pyx":1339
 *     p.y = y
 *     p.z = z
 *     return p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1334
 * 
 * 
 * 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":1342
 * 
 * 
 * cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent e
 *     e.width  = w
 */

static struct __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaExtent __pyx_v_e;
  struct __pyx_t_4cuda_7ccudart_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], 1342, 1, __PYX_ERR(0, 1342, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1344
 * 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":1345
 *     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":1346
 *     e.width  = w
 *     e.height = h
 *     e.depth  = d             # <<<<<<<<<<<<<<
 *     return e
 * 
 */
  __pyx_v_e.depth = __pyx_v_d;

  /* "cuda/_lib/ccudart/ccudart.pyx":1347
 *     e.height = h
 *     e.depth  = d
 *     return e             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_e;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1342
 * 
 * 
 * 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":1350
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForDevice(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForDevice(CYTHON_UNUSED double *__pyx_v_d) {
  __pyx_t_4cuda_7ccudart_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], 1350, 1, __PYX_ERR(0, 1350, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1351
 * 
 * cdef cudaError_t _cudaSetDoubleForDevice(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1350
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1354
 * 
 * 
 * cdef cudaError_t _cudaSetDoubleForHost(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDoubleForHost(CYTHON_UNUSED double *__pyx_v_d) {
  __pyx_t_4cuda_7ccudart_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], 1354, 1, __PYX_ERR(0, 1354, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1355
 * 
 * cdef cudaError_t _cudaSetDoubleForHost(double* d) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_4cuda_7ccudart_cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1354
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1358
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef int deviceOrdinal = 0
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDeviceFlags(unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  int __pyx_v_deviceOrdinal;
  unsigned int __pyx_v_scheduleFlags;
  __pyx_t_4cuda_5ccuda_CUcontext __pyx_v_context;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaSetDeviceFlags", __pyx_f[0], 1358, 1, __PYX_ERR(0, 1358, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1360
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1361
 *     cdef cudaError_t err
 *     cdef int deviceOrdinal = 0
 *     flags &= ~cudaDeviceMapHost             # <<<<<<<<<<<<<<
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_flags = (__pyx_v_flags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMapHost));

  /* "cuda/_lib/ccudart/ccudart.pyx":1362
 *     cdef int deviceOrdinal = 0
 *     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":1363
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1364
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1362
 *     cdef int deviceOrdinal = 0
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1365
 *         _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":1366
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  __pyx_t_2 = (__pyx_v_scheduleFlags != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1368
 *     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":1366
 *         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":1367
 *     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":1366
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
    __pyx_t_2 = 0;
    break;
    default:
    __pyx_t_2 = 1;
    break;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1369
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInit()
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1370
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1366
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1371
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1373
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext context
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1376
 * 
 *     cdef ccuda.CUcontext context
 *     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 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1376, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1378
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1379
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1380
 *         _setLastError(err)
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             break
 */
  __pyx_t_4 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":1381
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             break
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 */
    __pyx_t_1 = (((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_deviceOrdinal]) == __pyx_v_context) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1382
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             break             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 *     if err != cudaSuccess:
 */
      goto __pyx_L10_break;

      /* "cuda/_lib/ccudart/ccudart.pyx":1381
 *         return err
 *     for deviceOrdinal in range(m_global._numDevices):
 *         if m_global._driverContext[deviceOrdinal] == context:             # <<<<<<<<<<<<<<
 *             break
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 */
    }
  }
  __pyx_L10_break:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1383
 *         if m_global._driverContext[deviceOrdinal] == context:
 *             break
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverDevice[__pyx_v_deviceOrdinal]), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1383, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1384
 *             break
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1385
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1384
 *             break
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(m_global._driverDevice[deviceOrdinal], flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1358
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef int deviceOrdinal = 0
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1389
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemAllocNode(__pyx_t_4cuda_7ccudart_cudaGraphNode_t *__pyx_v_pGraphNode, __pyx_t_4cuda_7ccudart_cudaGraph_t __pyx_v_graph, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams *__pyx_v_nodeParams) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphAddMemAllocNode", __pyx_f[0], 1389, 1, __PYX_ERR(0, 1389, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1391
 * 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":1392
 *     cdef cudaError_t err
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1393
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1391
 * 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":1395
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1396
 * 
 *     err = m_global.lazyInit()
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1397
 *     err = m_global.lazyInit()
 *     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":1396
 * 
 *     err = m_global.lazyInit()
 *     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":1398
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, ((__pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1398, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1399
 *         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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1400
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1399
 *         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":1401
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1389
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1404
 * 
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if params_out == NULL:
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams *__pyx_v_params_out) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemAllocNodeGetParams", __pyx_f[0], 1404, 1, __PYX_ERR(0, 1404, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1406
 * 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":1407
 *     cdef cudaError_t err
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1408
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1406
 * 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":1410
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1411
 * 
 *     err = m_global.lazyInit()
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1412
 *     err = m_global.lazyInit()
 *     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":1411
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1413
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams(__pyx_v_node, ((__pyx_t_4cuda_5ccuda_CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_params_out)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1413, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1414
 *         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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1415
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1414
 *         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":1416
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1404
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1419
 * 
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     if dptr_out == NULL:
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, void *__pyx_v_dptr_out) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphMemFreeNodeGetParams", __pyx_f[0], 1419, 1, __PYX_ERR(0, 1419, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1421
 * 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":1422
 *     cdef cudaError_t err
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1423
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInit()
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1421
 * 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":1425
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1426
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1427
 *     err = m_global.lazyInit()
 *     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":1426
 * 
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1428
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams(__pyx_v_node, ((__pyx_t_4cuda_5ccuda_CUdeviceptr *)__pyx_v_dptr_out)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1428, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1429
 *         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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1430
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1429
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1419
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1434
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise(void const *__pyx_v_devPtr, size_t __pyx_v_count, enum __pyx_t_4cuda_7ccudart_cudaMemoryAdvise __pyx_v_advice, int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemAdvise", __pyx_f[0], 1434, 1, __PYX_ERR(0, 1434, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1436
 * 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(((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, ((__pyx_t_4cuda_5ccuda_CUmem_advise)__pyx_v_advice), ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1436, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1437
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1438
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1437
 *     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":1439
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1434
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1442
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute(void *__pyx_v_data, size_t __pyx_v_dataSize, enum __pyx_t_4cuda_7ccudart_cudaMemRangeAttribute __pyx_v_attribute, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemRangeGetAttribute", __pyx_f[0], 1442, 1, __PYX_ERR(0, 1442, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1444
 * 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, ((__pyx_t_4cuda_5ccuda_CUmem_range_attribute)__pyx_v_attribute), ((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1444, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1445
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1446
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1445
 *     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":1447
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1442
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1450
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttributes(void **__pyx_v_data, size_t *__pyx_v_dataSizes, enum __pyx_t_4cuda_7ccudart_cudaMemRangeAttribute *__pyx_v_attributes, size_t __pyx_v_numAttributes, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemRangeGetAttributes", __pyx_f[0], 1450, 1, __PYX_ERR(0, 1450, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1452
 * 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, ((__pyx_t_4cuda_5ccuda_CUmem_range_attribute *)__pyx_v_attributes), __pyx_v_numAttributes, ((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1452, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1453
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1454
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1453
 *     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":1455
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1450
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1458
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceCount(int *__pyx_v_count) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetDeviceCount", __pyx_f[0], 1458, 1, __PYX_ERR(0, 1458, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1460
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1461
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1462
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1461
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1463
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount(__pyx_v_count); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1463, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1464
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1465
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1464
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetCount(count)
 *     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":1458
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1469
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetAttribute(int *__pyx_v_value, enum __pyx_t_4cuda_7ccudart_cudaDeviceAttr __pyx_v_attr, int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetAttribute", __pyx_f[0], 1469, 1, __PYX_ERR(0, 1469, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1471
 * 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, ((__pyx_t_4cuda_5ccuda_CUdevice_attribute)__pyx_v_attr), ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1471, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1472
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1473
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1472
 *     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":1474
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1469
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1477
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig(enum __pyx_t_4cuda_7ccudart_cudaSharedMemConfig __pyx_v_config) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceSetSharedMemConfig", __pyx_f[0], 1477, 1, __PYX_ERR(0, 1477, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1479
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1480
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1481
 *     err = m_global.lazyInit()
 *     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":1480
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1482
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig(((__pyx_t_4cuda_5ccuda_CUsharedconfig)__pyx_v_config)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1482, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1483
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1484
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1483
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1477
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1488
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId(int *__pyx_v_device, char const *__pyx_v_pciBusId) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetByPCIBusId", __pyx_f[0], 1488, 1, __PYX_ERR(0, 1488, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1490
 * 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(((__pyx_t_4cuda_5ccuda_CUdevice *)__pyx_v_device), __pyx_v_pciBusId); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1490, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1491
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1492
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1491
 *     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":1493
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1488
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1496
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetPCIBusId(char *__pyx_v_pciBusId, int __pyx_v_length, int __pyx_v_device) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetPCIBusId", __pyx_f[0], 1496, 1, __PYX_ERR(0, 1496, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1498
 * 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, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1498, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1499
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1500
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1499
 *     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":1501
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1496
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1504
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetP2PAttribute(int *__pyx_v_value, enum __pyx_t_4cuda_7ccudart_cudaDeviceP2PAttr __pyx_v_attr, int __pyx_v_srcDevice, int __pyx_v_dstDevice) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceGetP2PAttribute", __pyx_f[0], 1504, 1, __PYX_ERR(0, 1504, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1506
 * 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, ((__pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute)__pyx_v_attr), ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_srcDevice), ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_dstDevice)); if (unlikely(__pyx_t_1 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1506, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1507
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1508
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1507
 *     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":1509
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1504
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1512
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetSparseProperties(struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties *__pyx_v_sparseProperties, __pyx_t_4cuda_7ccudart_cudaArray_t __pyx_v_array) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned PY_LONG_LONG __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaArrayGetSparseProperties", __pyx_f[0], 1512, 1, __PYX_ERR(0, 1512, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1515
 *     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":1516
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1517
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1515
 *     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":1518
 *         _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 __pyx_t_4cuda_7ccudart_cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1520
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((__pyx_t_4cuda_5ccuda_CUarray)__pyx_v_array)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1520, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1521
 * 
 *     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 == __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1522
 *     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_3 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1523
 *     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_4 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1524
 *         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_3 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1525
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1526
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1527
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1521
 * 
 *     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":1529
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1530
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1529
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1512
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1534
 * 
 * 
 * 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 __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties(struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties *__pyx_v_sparseProperties, __pyx_t_4cuda_7ccudart_cudaMipmappedArray_t __pyx_v_mipmap) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned PY_LONG_LONG __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMipmappedArrayGetSparseProperties", __pyx_f[0], 1534, 1, __PYX_ERR(0, 1534, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1537
 *     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":1538
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidValue));

    /* "cuda/_lib/ccudart/ccudart.pyx":1539
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1537
 *     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":1540
 *         _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 __pyx_t_4cuda_7ccudart_cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1542
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((__pyx_t_4cuda_5ccuda_CUmipmappedArray)__pyx_v_mipmap)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1542, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1543
 * 
 *     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 == __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1544
 *     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_3 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1545
 *     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_4 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1546
 *         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_3 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1547
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1548
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1549
 *         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_3 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1543
 * 
 *     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":1551
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1552
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1551
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1534
 * 
 * 
 * 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1556
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer(int *__pyx_v_canAccessPeer, int __pyx_v_device, int __pyx_v_peerDevice) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceCanAccessPeer", __pyx_f[0], 1556, 1, __PYX_ERR(0, 1556, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1558
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1559
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1560
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1559
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1561
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer(__pyx_v_canAccessPeer, ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_device), ((__pyx_t_4cuda_5ccuda_CUdevice)__pyx_v_peerDevice)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1562
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1563
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1562
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, <ccuda.CUdevice>device, <ccuda.CUdevice>peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1564
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     err = m_global.lazyInitDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1565
 *         _setLastError(err)
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1566
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if device == peerDevice:
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1567
 *     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":1565
 *         _setLastError(err)
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1568
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_device == __pyx_v_peerDevice) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1569
 *         return err
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (__pyx_v_canAccessPeer[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1568
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1570
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1556
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1573
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_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) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyPeer", __pyx_f[0], 1573, 1, __PYX_ERR(0, 1573, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1575
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1576
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1577
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1576
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1578
 *     if err != cudaSuccess:
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 */
  __pyx_t_2 = ((__pyx_v_dstDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_dstDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1579
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1578
 *     if err != cudaSuccess:
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1580
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 */
  __pyx_t_2 = ((__pyx_v_srcDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_srcDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1581
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1580
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1582
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer(((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_dst), (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_dstDevice]), ((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_src), (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_srcDevice]), __pyx_v_count); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1582, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1583
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1584
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1583
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1573
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1588
 * 
 * 
 * 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
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_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, __pyx_t_4cuda_7ccudart_cudaStream_t __pyx_v_stream) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaMemcpyPeerAsync", __pyx_f[0], 1588, 1, __PYX_ERR(0, 1588, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1590
 * 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
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1591
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1592
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1591
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1593
 *     if err != cudaSuccess:
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 */
  __pyx_t_2 = ((__pyx_v_dstDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_dstDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1594
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1593
 *     if err != cudaSuccess:
 *         return err
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1595
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = ((__pyx_v_srcDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_srcDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1596
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1595
 *     if dstDevice < 0 or dstDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1597
 *     if srcDevice < 0 or srcDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync(((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_dst), (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_dstDevice]), ((__pyx_t_4cuda_5ccuda_CUdeviceptr)__pyx_v_src), (__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_srcDevice]), __pyx_v_count, ((__pyx_t_4cuda_5ccuda_CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1597, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1598
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1599
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1598
 *         return cudaErrorInvalidDevice
 *     err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, m_global._driverContext[dstDevice], <ccuda.CUdeviceptr>src, m_global._driverContext[srcDevice], count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1588
 * 
 * 
 * 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
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1603
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess(int __pyx_v_peerDevice, unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceEnablePeerAccess", __pyx_f[0], 1603, 1, __PYX_ERR(0, 1603, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1605
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1606
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1607
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1606
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1608
 *     if err != cudaSuccess:
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  __pyx_t_2 = ((__pyx_v_peerDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_peerDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1609
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1608
 *     if err != cudaSuccess:
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1610
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1611
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1612
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1613
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1611
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1614
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_peerDevice]), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1614, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1615
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1616
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1615
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(m_global._driverContext[peerDevice], flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1603
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1620
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceDisablePeerAccess(int __pyx_v_peerDevice) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaDeviceDisablePeerAccess", __pyx_f[0], 1620, 1, __PYX_ERR(0, 1620, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1622
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1623
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1624
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1623
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1625
 *     if err != cudaSuccess:
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  __pyx_t_2 = ((__pyx_v_peerDevice < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_peerDevice >= __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1626
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1625
 *     if err != cudaSuccess:
 *         return err
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1627
 *     if peerDevice < 0 or peerDevice >= m_global._numDevices:
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice);

  /* "cuda/_lib/ccudart/ccudart.pyx":1628
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1629
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1630
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1628
 *         return cudaErrorInvalidDevice
 *     err = m_global.lazyInitDevice(peerDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1631
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess((__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_driverContext[__pyx_v_peerDevice])); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1631, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1632
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1633
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1632
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(m_global._driverContext[peerDevice])
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1634
 *     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":1620
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1636
 *     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.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedMipmappedArray(__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *__pyx_v_mipmap, __pyx_t_4cuda_7ccudart_cudaExternalMemory_t __pyx_v_extMem, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryMipmappedArrayDesc const *__pyx_v_mipmapDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC __pyx_v__driver_mipmapDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err_rt;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  unsigned PY_LONG_LONG __pyx_t_1;
  size_t __pyx_t_2;
  int __pyx_t_3;
  unsigned int __pyx_t_4;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedMipmappedArray", __pyx_f[0], 1636, 1, __PYX_ERR(0, 1636, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1638
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1640
 *     err = m_global.lazyInit()
 *     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":1641
 *     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_1 = (__pyx_v_mipmapDesc[0]).offset;
  __pyx_v__driver_mipmapDesc.offset = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1642
 *     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_2 = (__pyx_v_mipmapDesc[0]).extent.width;
  __pyx_v__driver_mipmapDesc.arrayDesc.Width = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1643
 *     _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_2 = (__pyx_v_mipmapDesc[0]).extent.height;
  __pyx_v__driver_mipmapDesc.arrayDesc.Height = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1644
 *     _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_2 = (__pyx_v_mipmapDesc[0]).extent.depth;
  __pyx_v__driver_mipmapDesc.arrayDesc.Depth = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1645
 *     _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_v_err_rt = __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));

  /* "cuda/_lib/ccudart/ccudart.pyx":1646
 *     _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_3 = ((__pyx_v_err_rt != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1647
 *     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
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err_rt));

    /* "cuda/_lib/ccudart/ccudart.pyx":1648
 *     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":1646
 *     _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":1649
 *         _setLastError(err_rt)
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 */
  __pyx_t_4 = (__pyx_v_mipmapDesc[0]).flags;
  __pyx_v__driver_mipmapDesc.arrayDesc.Flags = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1650
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_4 = (__pyx_v_mipmapDesc[0]).numLevels;
  __pyx_v__driver_mipmapDesc.numLevels = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1652
 *     _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_3 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1653
 * 
 *     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":1652
 *     _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":1654
 *     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_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray(((__pyx_t_4cuda_5ccuda_CUmipmappedArray *)__pyx_v_mipmap), ((__pyx_t_4cuda_5ccuda_CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_mipmapDesc)); if (unlikely(__pyx_t_5 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1654, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":1655
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_3 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1656
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1655
 *         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":1657
 *     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":1636
 *     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.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1659
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc(struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *__pyx_v_pResDesc, __pyx_t_4cuda_7ccudart_cudaSurfaceObject_t __pyx_v_surfObject) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  long __pyx_v_channel_size;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetSurfaceObjectResourceDesc", __pyx_f[0], 1659, 1, __PYX_ERR(0, 1659, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1661
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1664
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1665
 * 
 *     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":1664
 *     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":1666
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc((&__pyx_v__driver_pResDesc), ((__pyx_t_4cuda_5ccuda_CUsurfObject)__pyx_v_surfObject)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1666, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1667
 *         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 __pyx_t_4cuda_7ccudart_cudaResourceDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1668
 *     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 __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1669
 *     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 = __pyx_e_4cuda_7ccudart_cudaResourceTypeArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1670
 *     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 = ((__pyx_t_4cuda_7ccudart_cudaArray_t)__pyx_v__driver_pResDesc.res.array.hArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1668
 *     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 __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1672
 *         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 = __pyx_e_4cuda_7ccudart_cudaResourceTypeMipmappedArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1673
 *     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 = ((__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t)__pyx_v__driver_pResDesc.res.mipmap.hMipmappedArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1671
 *         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 __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_LINEAR:

    /* "cuda/_lib/ccudart/ccudart.pyx":1675
 *         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 = __pyx_e_4cuda_7ccudart_cudaResourceTypeLinear;

    /* "cuda/_lib/ccudart/ccudart.pyx":1676
 *     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":1677
 *         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_3 = __pyx_v__driver_pResDesc.res.linear.sizeInBytes;
    (__pyx_v_pResDesc[0]).res.linear.sizeInBytes = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1674
 *         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 __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1679
 *         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 = __pyx_e_4cuda_7ccudart_cudaResourceTypePitch2D;

    /* "cuda/_lib/ccudart/ccudart.pyx":1680
 *     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":1681
 *         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_3 = __pyx_v__driver_pResDesc.res.pitch2D.pitchInBytes;
    (__pyx_v_pResDesc[0]).res.pitch2D.pitchInBytes = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1682
 *         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_3 = __pyx_v__driver_pResDesc.res.pitch2D.width;
    (__pyx_v_pResDesc[0]).res.pitch2D.width = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1683
 *         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_3 = __pyx_v__driver_pResDesc.res.pitch2D.height;
    (__pyx_v_pResDesc[0]).res.pitch2D.height = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1678
 *         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":1684
 *         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 __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_LINEAR:
    case __pyx_e_4cuda_5ccuda_CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1685
 *         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":1686
 *     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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1687
 *         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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1688
 *         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":1686
 *     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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1690
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1691
 *         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":1689
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_UNSIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1693
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1694
 *         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":1692
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1696
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1697
 *         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":1695
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1699
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1700
 *         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":1698
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_SIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1702
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1703
 *         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":1701
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_HALF:

      /* "cuda/_lib/ccudart/ccudart.pyx":1705
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1706
 *         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":1704
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_FLOAT:

      /* "cuda/_lib/ccudart/ccudart.pyx":1708
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1709
 *         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":1707
 *             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 __pyx_e_4cuda_5ccuda_CU_AD_FORMAT_NV12:

      /* "cuda/_lib/ccudart/ccudart.pyx":1711
 *             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 = __pyx_e_4cuda_7ccudart_cudaChannelFormatKindNV12;

      /* "cuda/_lib/ccudart/ccudart.pyx":1712
 *         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":1710
 *             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":1714
 *             channel_size = 8
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)             # <<<<<<<<<<<<<<
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 *         pResDesc[0].res.linear.desc.x = 0
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidChannelDescriptor));

      /* "cuda/_lib/ccudart/ccudart.pyx":1715
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.x = 0
 *         pResDesc[0].res.linear.desc.y = 0
 */
      __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;
      break;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1716
 *             _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":1717
 *             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":1718
 *         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":1719
 *         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":1720
 *         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_1 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 4) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1721
 *         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":1720
 *         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":1722
 *         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_1 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 3) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1723
 *             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":1722
 *         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":1724
 *         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_1 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 2) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1725
 *             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":1724
 *         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":1726
 *         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_1 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 1) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1727
 *             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":1726
 *         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":1728
 *         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_4 = ((__pyx_v__driver_pResDesc.res.linear.numChannels < 1) != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_4 = ((__pyx_v__driver_pResDesc.res.linear.numChannels >= 5) != 0);
    __pyx_t_1 = __pyx_t_4;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1729
 *             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
 * 
 */
      (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_e_4cuda_7ccudart_cudaErrorInvalidChannelDescriptor));

      /* "cuda/_lib/ccudart/ccudart.pyx":1730
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
      __pyx_r = __pyx_e_4cuda_7ccudart_cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1728
 *         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":1684
 *         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":1732
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1733
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1732
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1734
 *     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":1659
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1736
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams(__pyx_t_4cuda_7ccudart_cudaGraphNode_t __pyx_v_node, struct __pyx_t_4cuda_7ccudart_cudaKernelNodeParams *__pyx_v_pNodeParams) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_KERNEL_NODE_PARAMS __pyx_v__driver_pNodeParams;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_2;
  unsigned int __pyx_t_3;
  void **__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGraphKernelNodeGetParams", __pyx_f[0], 1736, 1, __PYX_ERR(0, 1736, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1738
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS _driver_pNodeParams
 * 
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1741
 *     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_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1742
 * 
 *     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":1741
 *     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":1743
 *     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_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams(((__pyx_t_4cuda_5ccuda_CUgraphNode)__pyx_v_node), (&__pyx_v__driver_pNodeParams)); if (unlikely(__pyx_t_2 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1743, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1744
 *         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":1745
 *     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_3 = __pyx_v__driver_pNodeParams.gridDimX;
  (__pyx_v_pNodeParams[0]).gridDim.x = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1746
 *     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_3 = __pyx_v__driver_pNodeParams.gridDimY;
  (__pyx_v_pNodeParams[0]).gridDim.y = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1747
 *     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_3 = __pyx_v__driver_pNodeParams.gridDimZ;
  (__pyx_v_pNodeParams[0]).gridDim.z = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1748
 *     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_3 = __pyx_v__driver_pNodeParams.blockDimX;
  (__pyx_v_pNodeParams[0]).blockDim.x = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1749
 *     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_3 = __pyx_v__driver_pNodeParams.blockDimY;
  (__pyx_v_pNodeParams[0]).blockDim.y = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1750
 *     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_3 = __pyx_v__driver_pNodeParams.blockDimZ;
  (__pyx_v_pNodeParams[0]).blockDim.z = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1751
 *     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_3 = __pyx_v__driver_pNodeParams.sharedMemBytes;
  (__pyx_v_pNodeParams[0]).sharedMemBytes = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1752
 *     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.kernelParams;
  (__pyx_v_pNodeParams[0]).kernelParams = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1753
 *     pNodeParams[0].sharedMemBytes = _driver_pNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = _driver_pNodeParams.kernelParams
 *     pNodeParams[0].extra = _driver_pNodeParams.extra             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_4 = __pyx_v__driver_pNodeParams.extra;
  (__pyx_v_pNodeParams[0]).extra = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1755
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1756
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1755
 *     pNodeParams[0].extra = _driver_pNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1757
 *     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":1736
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1759
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer(void **__pyx_v_devPtr, __pyx_t_4cuda_7ccudart_cudaExternalMemory_t __pyx_v_extMem, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryBufferDesc const *__pyx_v_bufferDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_BUFFER_DESC __pyx_v__driver_bufferDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  unsigned PY_LONG_LONG __pyx_t_1;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedBuffer", __pyx_f[0], 1759, 1, __PYX_ERR(0, 1759, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1761
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1763
 *     err = m_global.lazyInit()
 *     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":1764
 *     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_1 = (__pyx_v_bufferDesc[0]).offset;
  __pyx_v__driver_bufferDesc.offset = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1765
 *     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_1 = (__pyx_v_bufferDesc[0]).size;
  __pyx_v__driver_bufferDesc.size = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1766
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size
 *     _driver_bufferDesc.flags = bufferDesc[0].flags             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_2 = (__pyx_v_bufferDesc[0]).flags;
  __pyx_v__driver_bufferDesc.flags = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1768
 *     _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_3 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1769
 * 
 *     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":1768
 *     _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":1770
 *     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_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer(((__pyx_t_4cuda_5ccuda_CUdeviceptr *)__pyx_v_devPtr), ((__pyx_t_4cuda_5ccuda_CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_bufferDesc)); if (unlikely(__pyx_t_4 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1770, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1771
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_3 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1772
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1771
 *         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":1773
 *     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":1759
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1775
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory(__pyx_t_4cuda_7ccudart_cudaExternalMemory_t *__pyx_v_extMem_out, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleDesc const *__pyx_v_memHandleDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_MEMORY_HANDLE_DESC __pyx_v__driver_memHandleDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  void *__pyx_t_3;
  unsigned PY_LONG_LONG __pyx_t_4;
  unsigned int __pyx_t_5;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaImportExternalMemory", __pyx_f[0], 1775, 1, __PYX_ERR(0, 1775, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1777
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1779
 *     err = m_global.lazyInit()
 *     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":1781
 *     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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueFd) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1782
 * 
 *     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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":1783
 *     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_2 = (__pyx_v_memHandleDesc[0]).handle.fd;
    __pyx_v__driver_memHandleDesc.handle.fd = __pyx_t_2;

    /* "cuda/_lib/ccudart/ccudart.pyx":1781
 *     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":1784
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueWin32) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1785
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":1786
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1787
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1784
 *         _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":1788
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeOpaqueWin32Kmt) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1789
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1790
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1791
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1788
 *         _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":1792
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D12Heap) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1793
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP;

    /* "cuda/_lib/ccudart/ccudart.pyx":1794
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1795
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1792
 *         _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":1796
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D12Resource) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1797
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1798
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1799
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1796
 *         _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":1800
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D11Resource) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1801
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1802
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1803
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1800
 *         _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":1804
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeD3D11ResourceKmt) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1805
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1806
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1807
 *         _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_3 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1804
 *         _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":1808
 *         _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_1 = (((__pyx_v_memHandleDesc[0]).type == __pyx_e_4cuda_7ccudart_cudaExternalMemoryHandleTypeNvSciBuf) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1809
 *         _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 = __pyx_e_4cuda_5ccuda_CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF;

    /* "cuda/_lib/ccudart/ccudart.pyx":1810
 *     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_3 = (__pyx_v_memHandleDesc[0]).handle.nvSciBufObject;
    __pyx_v__driver_memHandleDesc.handle.nvSciBufObject = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1808
 *         _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":1811
 *         _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_4 = (__pyx_v_memHandleDesc[0]).size;
  __pyx_v__driver_memHandleDesc.size = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1812
 *         _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_5 = (__pyx_v_memHandleDesc[0]).flags;
  __pyx_v__driver_memHandleDesc.flags = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1814
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1815
 * 
 *     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":1814
 *     _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":1816
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_6 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory(((__pyx_t_4cuda_5ccuda_CUexternalMemory *)__pyx_v_extMem_out), (&__pyx_v__driver_memHandleDesc)); if (unlikely(__pyx_t_6 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1816, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_6);

  /* "cuda/_lib/ccudart/ccudart.pyx":1817
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1818
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1817
 *         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":1819
 *     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":1775
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1821
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject(__pyx_t_4cuda_7ccudart_cudaSurfaceObject_t *__pyx_v_pSurfObject, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *__pyx_v_pResDesc) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaCreateSurfaceObject", __pyx_f[0], 1821, 1, __PYX_ERR(0, 1821, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1823
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1825
 *     err = m_global.lazyInit()
 *     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":1826
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1826, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1827
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1828
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1829
 *     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":1827
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1831
 *         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(((__pyx_t_4cuda_5ccuda_CUsurfObject *)__pyx_v_pSurfObject), (&__pyx_v__driver_pResDesc)); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1831, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1832
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1833
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1832
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1834
 *     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":1821
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1836
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

static __pyx_t_4cuda_7ccudart_cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc(struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *__pyx_v_pResDesc, __pyx_t_4cuda_7ccudart_cudaTextureObject_t __pyx_v_texObject) {
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  __pyx_t_4cuda_7ccudart_cudaError_t __pyx_t_1;
  int __pyx_t_2;
  __pyx_t_4cuda_5ccuda_CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("_cudaGetTextureObjectResourceDesc", __pyx_f[0], 1836, 1, __PYX_ERR(0, 1836, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1838
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
  __pyx_v_err = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInit(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global);

  /* "cuda/_lib/ccudart/ccudart.pyx":1840
 *     err = m_global.lazyInit()
 *     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":1841
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  try {
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc);
  } catch(...) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_CppExn2PyErr();
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1841, __pyx_L1_error)
  }
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1842
 *     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 != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1843
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1844
 *     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":1842
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1846
 *         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), ((__pyx_t_4cuda_5ccuda_CUtexObject)__pyx_v_texObject)); if (unlikely(__pyx_t_3 == ((__pyx_t_4cuda_5ccuda_CUresult)__pyx_e_4cuda_5ccuda_CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1846, __pyx_L1_error)
  __pyx_v_err = ((__pyx_t_4cuda_7ccudart_cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1847
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = ((__pyx_v_err != __pyx_e_4cuda_7ccudart_cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1848
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 */
    (void)(__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err));

    /* "cuda/_lib/ccudart/ccudart.pyx":1847
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1836
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     err = m_global.lazyInit()
 */

  /* 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 = __pyx_e_4cuda_7ccudart_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, 1009, __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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreate, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreate, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaEvent_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventQuery", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventQuery, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc (int, int, int, int, enum __pyx_t_4cuda_7ccudart_cudaChannelFormatKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDriverGetVersion", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDriverGetVersion, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (size_t *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t *, __pyx_t_4cuda_7ccudart_cudaGraph_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *, size_t, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode1D, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t *, __pyx_t_4cuda_7ccudart_cudaGraph_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *, size_t, void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams1D, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t, void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphExec_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams1D, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphExec_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t, void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDriverEntryPoint", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDriverEntryPoint, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t *, __pyx_t_4cuda_7ccudart_cudaGraph_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *, size_t, struct __pyx_t_4cuda_7ccudart_cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemsetNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemsetNodeSetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphExec_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeGetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncGetAttributes, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr *, struct __pyx_t_4cuda_7ccudart_cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc3DArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3DArray, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t *, struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, struct __pyx_t_4cuda_7ccudart_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 *(__pyx_t_4cuda_7ccudart_cudaError_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamAddCallback", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAddCallback, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t, enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, __pyx_t_4cuda_7ccudart_cudaGraph_t *, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t *, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSignalExternalSemaphoresAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t const *, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreSignalParams const *, unsigned int, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaWaitExternalSemaphoresAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaExternalSemaphore_t const *, struct __pyx_t_4cuda_7ccudart_cudaExternalSemaphoreWaitParams const *, unsigned int, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetInfo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *, struct __pyx_t_4cuda_7ccudart_cudaExtent *, unsigned int *, __pyx_t_4cuda_7ccudart_cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr, int, struct __pyx_t_4cuda_7ccudart_cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr, int, struct __pyx_t_4cuda_7ccudart_cudaExtent, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaPointerGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolSetAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaMemPool_t, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaDeviceProp *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaChooseDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice, "__pyx_t_4cuda_7ccudart_cudaError_t (int *, struct __pyx_t_4cuda_7ccudart_cudaDeviceProp const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetChannelDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaTextureObject_t *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc const *, struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectTextureDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaTextureDesc *, __pyx_t_4cuda_7ccudart_cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceViewDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc *, __pyx_t_4cuda_7ccudart_cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetExportTable", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable, "__pyx_t_4cuda_7ccudart_cudaError_t (void const **, __pyx_t_4cuda_7ccudart_cudaUUID_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeerAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DPeerParms const *, __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t *, __pyx_t_4cuda_7ccudart_cudaGraph_t, __pyx_t_4cuda_7ccudart_cudaGraphNode_t const *, size_t, struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemAllocNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemFreeNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemoryAdvise, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemRangeGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, size_t, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void **, size_t *, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (int *, enum __pyx_t_4cuda_7ccudart_cudaDeviceAttr, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetSharedMemConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig, "__pyx_t_4cuda_7ccudart_cudaError_t (enum __pyx_t_4cuda_7ccudart_cudaSharedMemConfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetByPCIBusId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (int *, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties *, __pyx_t_4cuda_7ccudart_cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMipmappedArrayGetSparseProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaArraySparseProperties *, __pyx_t_4cuda_7ccudart_cudaMipmappedArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceCanAccessPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, int, void const *, int, size_t, __pyx_t_4cuda_7ccudart_cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceEnablePeerAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *, __pyx_t_4cuda_7ccudart_cudaExternalMemory_t, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryMipmappedArrayDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetSurfaceObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *, __pyx_t_4cuda_7ccudart_cudaSurfaceObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaGraphNode_t, struct __pyx_t_4cuda_7ccudart_cudaKernelNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaExternalMemoryGetMappedBuffer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer, "__pyx_t_4cuda_7ccudart_cudaError_t (void **, __pyx_t_4cuda_7ccudart_cudaExternalMemory_t, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryBufferDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaImportExternalMemory", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaExternalMemory_t *, struct __pyx_t_4cuda_7ccudart_cudaExternalMemoryHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateSurfaceObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaSurfaceObject_t *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *, __pyx_t_4cuda_7ccudart_cudaTextureObject_t)") < 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, 14, __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_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) __PYX_ERR(1, 14, __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, 14, __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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "cuTexObjectGetResourceViewDesc", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "cudaSetDevice", (void (**)(void))&__pyx_f_4cuda_7ccudart_cudaSetDevice, "__pyx_t_4cuda_7ccudart_cudaError_t (int)") < 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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGet", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdevice *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDeviceGetCount", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount, "__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (size_t *, __pyx_t_4cuda_5ccuda_CUarray_format, unsigned int, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (int *, __pyx_t_4cuda_5ccuda_CUdevice_attribute, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdevice, unsigned int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDevicePrimaryCtxReset_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxSetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUcontext *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags, "__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (char *, int, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, __pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, __pyx_t_4cuda_5ccuda_CUdeviceptr, __pyx_t_4cuda_5ccuda_CUcontext, size_t, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_ARRAY_SPARSE_PROPERTIES *, __pyx_t_4cuda_5ccuda_CUmipmappedArray)") < 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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_ARRAY3D_DESCRIPTOR *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUmemoryPool, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdeviceptr, size_t, __pyx_t_4cuda_5ccuda_CUmem_advise, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (void *, size_t, __pyx_t_4cuda_5ccuda_CUmem_range_attribute, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (void **, size_t *, __pyx_t_4cuda_5ccuda_CUmem_range_attribute *, size_t, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (unsigned int, __pyx_t_4cuda_5ccuda_CUpointer_attribute *, void **, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUstream *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuEventCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUexternalMemory *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUdeviceptr *, __pyx_t_4cuda_5ccuda_CUexternalMemory, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUmipmappedArray *, __pyx_t_4cuda_5ccuda_CUexternalMemory, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUexternalSemaphore *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUexternalSemaphore const *, __pyx_t_4cuda_5ccuda_CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (int *, __pyx_t_4cuda_5ccuda_CUfunction_attribute, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode *, __pyx_t_4cuda_5ccuda_CUgraph, __pyx_t_4cuda_5ccuda_CUgraphNode const *, size_t, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphExec, __pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUgraphExec, __pyx_t_4cuda_5ccuda_CUgraphNode, __pyx_t_4cuda_5ccuda_CUDA_MEMSET_NODE_PARAMS const *, __pyx_t_4cuda_5ccuda_CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuTexObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUtexObject *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC const *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUsurfObject *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (int *, __pyx_t_4cuda_5ccuda_CUdevice, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (__pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (int *, __pyx_t_4cuda_5ccuda_CUdevice_P2PAttribute, __pyx_t_4cuda_5ccuda_CUdevice, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (char const *, void **, int, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_5ccuda_CUresult (void const **, __pyx_t_4cuda_5ccuda_CUuuid const *)") < 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, "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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc const *, int *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaStream_t, enum __pyx_t_4cuda_7ccudart_cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, __pyx_t_4cuda_7ccudart_cudaGraph_t *, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaChannelFormatDesc *, size_t *, size_t *, size_t *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_const_t, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc const *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_VIEW_DESC *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaResourceDesc *, __pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC const *, struct __pyx_t_4cuda_7ccudart_cudaTextureDesc *, __pyx_t_4cuda_5ccuda_CUDA_TEXTURE_DESC const *, struct __pyx_t_4cuda_7ccudart_cudaResourceViewDesc *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, struct __pyx_t_4cuda_7ccudart_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 __pyx_t_4cuda_7ccudart_cudaMemsetParams const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *, __pyx_t_4cuda_5ccuda_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaMipmappedArray_t *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (char *, size_t, char const *, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaMemcpy3DParms const *, bool, int, int, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (void *, void const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_5ccuda_CUDA_MEMCPY3D_v2 const *, struct __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (char *, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (struct __pyx_t_4cuda_7ccudart_cudaPitchedPtr, int, struct __pyx_t_4cuda_7ccudart_cudaExtent, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, char const *, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (char *, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_cudaMemcpyKind, __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_7ccudart_cudaArray_t, size_t, size_t, __pyx_t_4cuda_7ccudart_cudaArray_const_t, size_t, size_t, size_t, enum __pyx_t_4cuda_7ccudart_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, "__pyx_t_4cuda_7ccudart_cudaError_t (__pyx_t_4cuda_5ccuda_CUDA_RESOURCE_DESC *, struct __pyx_t_4cuda_7ccudart_cudaResourceDesc const *)") < 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 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();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#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, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#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;
#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;
#endif
    if ((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;
    }
    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_NCP_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"
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;
    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) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __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[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        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 */
