/* Generated by Cython 3.0.7 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/io/cuda-12.2/include/cuda",
            "/io/cuda-12.2/include/cuda.h",
            "/io/cuda-12.2/include/cudaProfiler.h",
            "/io/cuda-12.2/include/cuda_runtime_api.h",
            "/io/cuda-12.2/include/device_types.h",
            "/io/cuda-12.2/include/driver_types.h",
            "/io/cuda-12.2/include/library_types.h",
            "/io/cuda-12.2/include/surface_types.h",
            "/io/cuda-12.2/include/texture_types.h",
            "/io/cuda-12.2/include/vector_types.h"
        ],
        "extra_compile_args": [
            "-std=c++14",
            "-fpermissive",
            "-Wno-deprecated-declarations",
            "-D _GLIBCXX_ASSERTIONS",
            "-fno-var-tracking-assignments",
            "-O3"
        ],
        "include_dirs": [
            "cuda",
            "/opt/conda/conda-bld/cuda-python_1705519350711/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/include",
            "/io/cuda-12.2/include"
        ],
        "language": "c++",
        "library_dirs": [
            "/opt/conda/conda-bld/cuda-python_1705519350711/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.10/site-packages",
            "/opt/conda/conda-bld/cuda-python_1705519350711/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib"
        ],
        "name": "cuda._lib.ccudart.ccudart",
        "sources": [
            "cuda/_lib/ccudart/ccudart.pyx"
        ]
    },
    "module_name": "cuda._lib.ccudart.ccudart"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#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 < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_7" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x030007F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !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
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #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
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef 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
  #ifndef 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_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#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(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #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_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #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 short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #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
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

#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 ==(const U& other) const { return *ptr == other; }
    template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
    template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
    template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
  private:
    T *ptr;
};

#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_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, 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)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, 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 *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info; // borrowed
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11; // we don't yet need to distinguish between versions > 11
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, 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) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);  // we don't have access to __pyx_empty_bytes here
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, 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
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#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 Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 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_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#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_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_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_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#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 CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#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 PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || 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 > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)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, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)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] = (Py_UNICODE) 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
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#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
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_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_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#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 __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_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
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#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 CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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

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

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
    #define __PYX_EXTERN_C extern "C++"
#endif

#define __PYX_HAVE__cuda___lib__ccudart__ccudart
#define __PYX_HAVE_API__cuda___lib__ccudart__ccudart
/* Early includes */
#include <stdint.h>
#include "cuda.h"
#include "cudaProfiler.h"
#include "vector_types.h"
#include "driver_types.h"
#include "surface_types.h"
#include "texture_types.h"
#include "library_types.h"
#include "cuda_runtime_api.h"
#include "device_types.h"
#include <string.h>
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#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_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __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)
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
{
    const wchar_t *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
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);
}
#endif
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#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
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else  // Py < 3.12
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
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] = (char) 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
#include <string.h>
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; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "cuda/_lib/ccudart/ccudart.pyx",
  "cuda/_lib/ccudart/utils.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* 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()

/* #### Code section: numeric_typedefs ### */

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

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

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

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

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

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

/* "cuda/ccuda.pxd":2240
 * ctypedef uint32_t VdpVideoSurface
 * 
 * ctypedef uint32_t VdpOutputSurface             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_VdpOutputSurface;

/* "cuda/ccudart.pxd":1330
 *         cudaRoundMinInf = 3
 * 
 * ctypedef unsigned int GLenum             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int GLuint
 */
typedef unsigned int __pyx_t_4cuda_7ccudart_GLenum;

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

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

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

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

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

/* "cuda/ccudart.pxd":1357
 * ctypedef uint32_t VdpVideoSurface
 * 
 * ctypedef uint32_t VdpOutputSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeID cudaStreamAttrID
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpOutputSurface;
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

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

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

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

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

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

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

/* "cuda/ccuda.pxd":3076
 * cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
 * 
 * cdef enum: CUDA_VERSION = 12020             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_VERSION = 0x2EF4
};

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

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

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

/* "cuda/ccuda.pxd":3084
 * cdef enum: CU_STREAM_PER_THREAD = 2
 * 
 * cdef enum: CU_COMPUTE_ACCELERATED_TARGET_BASE = 65536             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_COMPUTE_ACCELERATED_TARGET_BASE = 0x10000
};

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

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

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

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

/* "cuda/ccuda.pxd":3094
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8
};

/* "cuda/ccuda.pxd":3096
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
};

/* "cuda/ccuda.pxd":3098
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
};

/* "cuda/ccuda.pxd":3100
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
};

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

/* "cuda/ccuda.pxd":3104
 * cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_PRIORITY = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_PRIORITY = 8
};

/* "cuda/ccuda.pxd":3106
 * cdef enum: CU_STREAM_ATTRIBUTE_PRIORITY = 8
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
};

/* "cuda/ccuda.pxd":3108
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
};

/* "cuda/ccuda.pxd":3110
 * cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
 * 
 * cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_MEMHOSTALLOC_PORTABLE = 1
};

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

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

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

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

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

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

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

/* "cuda/ccuda.pxd":3126
 * cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1
 * 
 * cdef enum: CU_TENSOR_MAP_NUM_QWORDS = 16             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_TENSOR_MAP_NUM_QWORDS = 16
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccuda.pxd":3188
 * 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":3190
 * cdef enum: CU_DEVICE_CPU = -1
 * 
 * cdef enum: CU_DEVICE_INVALID = -2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_INVALID = -2L
};

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

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

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

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

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

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

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

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

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

/* "cuda/ccuda.pxd":2197
 *     cdef struct CUeglStreamConnection_st:
 *         pass
 * ctypedef CUeglStreamConnection_st* CUeglStreamConnection             # <<<<<<<<<<<<<<
 * 
 * cdef enum CUGLDeviceList_enum:
 */
typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_5ccuda_CUeglStreamConnection;

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

/* "cuda/ccuda.pxd":2211
 *     CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2
 * 
 * ctypedef CUGLmap_flags_enum CUGLmap_flags             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int GLenum
 */
typedef enum __pyx_t_4cuda_5ccuda_CUGLmap_flags_enum __pyx_t_4cuda_5ccuda_CUGLmap_flags;

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

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

/* "cuda/ccuda.pxd":2232
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLSyncKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpDevice
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLSyncKHR;
struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st;
union __pyx_t_4cuda_7ccudart_anon_union8;
struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st;

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

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

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

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

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

/* "cuda/ccudart.pxd":2100
 * cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
 * 
 * cdef enum: cudaHostAllocDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocPortable = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocDefault = 0
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2158
 * cdef enum: cudaDeviceMapHost = 8
 * 
 * cdef enum: cudaDeviceLmemResizeToMax = 16             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceSyncMemops = 128
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceLmemResizeToMax = 16
};

/* "cuda/ccudart.pxd":2160
 * cdef enum: cudaDeviceLmemResizeToMax = 16
 * 
 * cdef enum: cudaDeviceSyncMemops = 128             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaDeviceMask = 255
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceSyncMemops = 0x80
};

/* "cuda/ccudart.pxd":2162
 * cdef enum: cudaDeviceSyncMemops = 128
 * 
 * cdef enum: cudaDeviceMask = 255             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaArrayDefault = 0
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaDeviceMask = 0xFF
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2196
 * cdef enum: cudaInvalidDeviceId = -2
 * 
 * cdef enum: cudaInitDeviceFlagsAreValid = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaInitDeviceFlagsAreValid = 1
};

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2216
 * cdef enum: cudaNvSciSyncAttrWait = 2
 * 
 * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeAccessPolicyWindow = 1
};

/* "cuda/ccudart.pxd":2218
 * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1
 * 
 * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeSynchronizationPolicy = 3
};

/* "cuda/ccudart.pxd":2220
 * cdef enum: cudaStreamAttributeSynchronizationPolicy = 3
 * 
 * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamAttributeMemSyncDomain = 10
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeMemSyncDomainMap = 9
};

/* "cuda/ccudart.pxd":2222
 * cdef enum: cudaStreamAttributeMemSyncDomainMap = 9
 * 
 * cdef enum: cudaStreamAttributeMemSyncDomain = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamAttributePriority = 8
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributeMemSyncDomain = 10
};

/* "cuda/ccudart.pxd":2224
 * cdef enum: cudaStreamAttributeMemSyncDomain = 10
 * 
 * cdef enum: cudaStreamAttributePriority = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaStreamAttributePriority = 8
};

/* "cuda/ccudart.pxd":2226
 * cdef enum: cudaStreamAttributePriority = 8
 * 
 * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeCooperative = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeAccessPolicyWindow = 1
};

/* "cuda/ccudart.pxd":2228
 * cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1
 * 
 * cdef enum: cudaKernelNodeAttributeCooperative = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributePriority = 8
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeCooperative = 2
};

/* "cuda/ccudart.pxd":2230
 * cdef enum: cudaKernelNodeAttributeCooperative = 2
 * 
 * cdef enum: cudaKernelNodeAttributePriority = 8             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributePriority = 8
};

/* "cuda/ccudart.pxd":2232
 * cdef enum: cudaKernelNodeAttributePriority = 8
 * 
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeClusterDimension = 4
};

/* "cuda/ccudart.pxd":2234
 * cdef enum: cudaKernelNodeAttributeClusterDimension = 4
 * 
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
};

/* "cuda/ccudart.pxd":2236
 * cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5
 * 
 * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeMemSyncDomainMap = 9
};

/* "cuda/ccudart.pxd":2238
 * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9
 * 
 * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1D = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeMemSyncDomain = 10
};

/* "cuda/ccudart.pxd":2240
 * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10
 * 
 * cdef enum: cudaSurfaceType1D = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2D = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1D = 1
};

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2268
 * cdef enum: cudaTextureTypeCubemapLayered = 252
 * 
 * cdef enum: CUDART_VERSION = 12020             # <<<<<<<<<<<<<<
 * 
 * cdef enum: __CUDART_API_VERSION = 12020
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDART_VERSION = 0x2EF4
};

/* "cuda/ccudart.pxd":2270
 * cdef enum: CUDART_VERSION = 12020
 * 
 * cdef enum: __CUDART_API_VERSION = 12020             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EGL_MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart___CUDART_API_VERSION = 0x2EF4
};

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

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

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

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

/* "cuda/ccudart.pxd":1359
 * ctypedef uint32_t VdpOutputSurface
 * 
 * ctypedef cudaLaunchAttributeID cudaStreamAttrID             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID
 */
typedef enum cudaLaunchAttributeID __pyx_t_4cuda_7ccudart_cudaStreamAttrID;

/* "cuda/ccudart.pxd":1361
 * ctypedef cudaLaunchAttributeID cudaStreamAttrID
 * 
 * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue
 */
typedef enum cudaLaunchAttributeID __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID;

/* "cuda/ccudart.pxd":1363
 * ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID
 * 
 * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue
 */
typedef union cudaLaunchAttributeValue __pyx_t_4cuda_7ccudart_cudaStreamAttrValue;

/* "cuda/ccudart.pxd":1365
 * ctypedef cudaLaunchAttributeValue cudaStreamAttrValue
 * 
 * ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaEglFrameType_enum:
 */
typedef union cudaLaunchAttributeValue __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue;

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

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

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

/* "cuda/ccudart.pxd":1493
 * ctypedef cudaEglColorFormat_enum cudaEglColorFormat
 * 
 * cdef struct cudaEglPlaneDesc_st:             # <<<<<<<<<<<<<<
 *     unsigned int width
 *     unsigned int height
 */
struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st {
  unsigned int width;
  unsigned int height;
  unsigned int depth;
  unsigned int pitch;
  unsigned int numChannels;
  struct cudaChannelFormatDesc channelDesc;
  unsigned int reserved[4];
};

/* "cuda/ccudart.pxd":1502
 *     unsigned int reserved[4]
 * 
 * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc             # <<<<<<<<<<<<<<
 * 
 * cdef union anon_union8:
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc;

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

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

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

/* "cuda/ccudart.pxd":1520
 *     cdef struct CUeglStreamConnection_st:
 *         pass
 * ctypedef CUeglStreamConnection_st* cudaEglStreamConnection             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGLDeviceList:
 */
typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_7ccudart_cudaEglStreamConnection;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice;

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

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



struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal {
  cudaError_t (*lazyInitDriver)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *);
  cudaError_t (*lazyInitContextState)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDevice)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, int);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDeviceFromDriver)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUdevice);
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*getDeviceFromPrimaryCtx)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUcontext);
};
static struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #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); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #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_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#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)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  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 && PY_VERSION_HEX < 0x030C00A6
#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

/* 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

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

/* Profile.proto */
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
  #define CYTHON_PROFILE 0
#else
  #define CYTHON_PROFILE 1
#endif
#endif
#ifndef CYTHON_TRACE_NOGIL
  #define CYTHON_TRACE_NOGIL 0
#else
  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
    #define CYTHON_TRACE 1
  #endif
#endif
#ifndef CYTHON_TRACE
  #define CYTHON_TRACE 0
#endif
#if CYTHON_TRACE
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL(frame)
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
  #endif
  #define __Pyx_TraceDeclarations\
      static PyCodeObject *__pyx_frame_code = NULL;\
      CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
      int __Pyx_use_tracing = 0;
  #define __Pyx_TraceFrameInit(codeobj)\
      if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
#if PY_VERSION_HEX >= 0x030b00a2
  #if PY_VERSION_HEX >= 0x030C00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     ((!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #else
  #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)))
  #endif
  #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 = __Pyx_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);\
              }\
              __Pyx_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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_7
#define __PYX_HAVE_RT_ImportType_proto_3_0_7
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_7(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_7(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_7 {
   __Pyx_ImportType_CheckSize_Error_3_0_7 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_7 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_7 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_7(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_7 check_size);
#endif

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
#endif

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

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && 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);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* 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)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#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_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

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

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

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

/* #### Code section: module_declarations ### */

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

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

/* Module declarations from "cuda.ccudart" */

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

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

/* Module declarations from "libcpp" */

/* Module declarations from "cuda._cuda.ccuda" */
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString)(CUresult, char const **); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion)(int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth)(size_t *, CUarray_format, unsigned int, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetNvSciSyncAttributes)(void *, CUdevice, int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetMemPool)(CUdevice, CUmemoryPool); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetMemPool)(CUmemoryPool *, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetDefaultMemPool)(CUmemoryPool *, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFlushGPUDirectRDMAWrites)(CUflushGPUDirectRDMAWritesTarget, CUflushGPUDirectRDMAWritesScope); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2)(CUdevice, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState)(CUdevice, unsigned int *, int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent)(CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent)(CUcontext *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice)(CUdevice *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags)(unsigned int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSynchronize)(void); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetLimit)(CUlimit, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetLimit)(size_t *, CUlimit); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCacheConfig)(CUfunc_cache *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCacheConfig)(CUfunc_cache); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetSharedMemConfig)(CUsharedconfig *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig)(CUsharedconfig); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetStreamPriorityRange)(int *, int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxResetPersistingL2Cache)(void); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemGetInfo_v2)(size_t *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAlloc_v2)(CUdeviceptr *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemFree_v2)(CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeHost)(void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostAlloc)(void **, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetDevicePointer_v2)(CUdeviceptr *, void *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetFlags)(unsigned int *, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocManaged)(CUdeviceptr *, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId)(CUdevice *, char const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId)(char *, int, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetEventHandle)(CUipcEventHandle *, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenEventHandle)(CUevent *, CUipcEventHandle); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetMemHandle)(CUipcMemHandle *, CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenMemHandle_v2)(CUdeviceptr *, CUipcMemHandle, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuIpcCloseMemHandle)(CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostRegister_v2)(void *, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostUnregister)(void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8_v2)(CUdeviceptr, unsigned char, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8_v2)(CUdeviceptr, size_t, unsigned char, size_t, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8Async)(CUdeviceptr, unsigned char, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8Async)(CUdeviceptr, size_t, unsigned char, size_t, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties)(CUDA_ARRAY_SPARSE_PROPERTIES *, CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties)(CUDA_ARRAY_SPARSE_PROPERTIES *, CUmipmappedArray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements)(CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUarray, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements)(CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUmipmappedArray, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetPlane)(CUarray *, CUarray, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArrayDestroy)(CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2)(CUDA_ARRAY3D_DESCRIPTOR *, CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel)(CUarray *, CUmipmappedArray, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayDestroy)(CUmipmappedArray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeAsync)(CUdeviceptr, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocAsync)(CUdeviceptr *, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolTrimTo)(CUmemoryPool, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAttribute)(CUmemoryPool, CUmemPool_attribute, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAttribute)(CUmemoryPool, CUmemPool_attribute, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess)(CUmemoryPool, CUmemAccessDesc const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAccess)(CUmemAccess_flags *, CUmemoryPool, CUmemLocation *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolCreate)(CUmemoryPool *, CUmemPoolProps const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolDestroy)(CUmemoryPool); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocFromPoolAsync)(CUdeviceptr *, size_t, CUmemoryPool, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportToShareableHandle)(void *, CUmemoryPool, CUmemAllocationHandleType, unsigned PY_LONG_LONG); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportFromShareableHandle)(CUmemoryPool *, void *, CUmemAllocationHandleType, unsigned PY_LONG_LONG); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportPointer)(CUmemPoolPtrExportData *, CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportPointer)(CUdeviceptr *, CUmemoryPool, CUmemPoolPtrExportData *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync)(CUdeviceptr, size_t, CUdevice, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync_v2)(CUdeviceptr, size_t, CUmemLocation, unsigned int, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise)(CUdeviceptr, size_t, CUmem_advise, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise_v2)(CUdeviceptr, size_t, CUmem_advise, CUmemLocation); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute)(void *, size_t, CUmem_range_attribute, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes)(void **, size_t *, CUmem_range_attribute *, size_t, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes)(unsigned int, CUpointer_attribute *, void **, CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate)(CUstream *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreateWithPriority)(CUstream *, unsigned int, int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetPriority)(CUstream, int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetFlags)(CUstream, unsigned int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetId)(CUstream, unsigned PY_LONG_LONG *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamWaitEvent)(CUstream, CUevent, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamBeginCapture_v2)(CUstream, CUstreamCaptureMode); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuThreadExchangeStreamCaptureMode)(CUstreamCaptureMode *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamEndCapture)(CUstream, CUgraph *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamIsCapturing)(CUstream, CUstreamCaptureStatus *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamUpdateCaptureDependencies)(CUstream, CUgraphNode *, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamAttachMemAsync)(CUstream, CUdeviceptr, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamQuery)(CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSynchronize)(CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamDestroy_v2)(CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCopyAttributes)(CUstream, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute)(CUstream, CUstreamAttrID, CUstreamAttrValue *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute)(CUstream, CUstreamAttrID, CUstreamAttrValue const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate)(CUevent *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventRecord)(CUevent, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventRecordWithFlags)(CUevent, CUstream, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery)(CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventSynchronize)(CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventDestroy_v2)(CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventElapsedTime)(float *, CUevent, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory)(CUexternalMemory *, CUDA_EXTERNAL_MEMORY_HANDLE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer)(CUdeviceptr *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_BUFFER_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray)(CUmipmappedArray *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalMemory)(CUexternalMemory); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore)(CUexternalSemaphore *, CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync)(CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync)(CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalSemaphore)(CUexternalSemaphore); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute)(int *, CUfunction_attribute, CUfunction); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetAttribute)(CUfunction, CUfunction_attribute, int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetCacheConfig)(CUfunction, CUfunc_cache); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetSharedMemConfig)(CUfunction, CUsharedconfig); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuLaunchHostFunc)(CUstream, CUhostFn, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphCreate)(CUgraph *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddKernelNode_v2)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_KERNEL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams_v2)(CUgraphNode, CUDA_KERNEL_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetParams_v2)(CUgraphNode, CUDA_KERNEL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMCPY3D const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams)(CUgraphNode, CUDA_MEMCPY3D *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams)(CUgraphNode, CUDA_MEMCPY3D const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMSET_NODE_PARAMS const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeGetParams)(CUgraphNode, CUDA_MEMSET_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeSetParams)(CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddHostNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_HOST_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeGetParams)(CUgraphNode, CUDA_HOST_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeSetParams)(CUgraphNode, CUDA_HOST_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddChildGraphNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUgraph); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphChildGraphNodeGetGraph)(CUgraphNode, CUgraph *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEmptyNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventRecordNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeGetEvent)(CUgraphNode, CUevent *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeSetEvent)(CUgraphNode, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventWaitNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeGetEvent)(CUgraphNode, CUevent *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeSetEvent)(CUgraphNode, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresSignalNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeGetParams)(CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeSetParams)(CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresWaitNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeGetParams)(CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeSetParams)(CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams)(CUgraphNode, CUDA_MEM_ALLOC_NODE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemFreeNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUdeviceptr); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams)(CUgraphNode, CUdeviceptr *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGraphMemTrim)(CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetGraphMemAttribute)(CUdevice, CUgraphMem_attribute, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetGraphMemAttribute)(CUdevice, CUgraphMem_attribute, void *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphClone)(CUgraph *, CUgraph); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeFindInClone)(CUgraphNode *, CUgraphNode, CUgraph); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetType)(CUgraphNode, CUgraphNodeType *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetNodes)(CUgraph, CUgraphNode *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetRootNodes)(CUgraph, CUgraphNode *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetEdges)(CUgraph, CUgraphNode *, CUgraphNode *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependencies)(CUgraphNode, CUgraphNode *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependentNodes)(CUgraphNode, CUgraphNode *, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddDependencies)(CUgraph, CUgraphNode const *, CUgraphNode const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphRemoveDependencies)(CUgraph, CUgraphNode const *, CUgraphNode const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroyNode)(CUgraphNode); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithFlags)(CUgraphExec *, CUgraph, unsigned PY_LONG_LONG); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithParams)(CUgraphExec *, CUgraph, CUDA_GRAPH_INSTANTIATE_PARAMS *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecGetFlags)(CUgraphExec, cuuint64_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecKernelNodeSetParams_v2)(CUgraphExec, CUgraphNode, CUDA_KERNEL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_MEMCPY3D const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *, CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecHostNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_HOST_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecChildGraphNodeSetParams)(CUgraphExec, CUgraphNode, CUgraph); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventRecordNodeSetEvent)(CUgraphExec, CUgraphNode, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventWaitNodeSetEvent)(CUgraphExec, CUgraphNode, CUevent); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresSignalNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresWaitNodeSetParams)(CUgraphExec, CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetEnabled)(CUgraphExec, CUgraphNode, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetEnabled)(CUgraphExec, CUgraphNode, unsigned int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphUpload)(CUgraphExec, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphLaunch)(CUgraphExec, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecDestroy)(CUgraphExec); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroy)(CUgraph); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecUpdate_v2)(CUgraphExec, CUgraph, CUgraphExecUpdateResultInfo *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeCopyAttributes)(CUgraphNode, CUgraphNode); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute)(CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute)(CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDebugDotPrint)(CUgraph, char const *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectCreate)(CUuserObject *, void *, CUhostFn, unsigned int, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRetain)(CUuserObject, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRelease)(CUuserObject, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphRetainUserObject)(CUgraph, CUuserObject, unsigned int, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphReleaseUserObject)(CUgraph, CUuserObject, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddNode)(CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUgraphNodeParams *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetParams)(CUgraphNode, CUgraphNodeParams *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecNodeSetParams)(CUgraphExec, CUgraphNode, CUgraphNodeParams *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessor)(int *, CUfunction, int, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)(int *, CUfunction, int, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyAvailableDynamicSMemPerBlock)(size_t *, CUfunction, int, int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate)(CUtexObject *, CUDA_RESOURCE_DESC const *, CUDA_TEXTURE_DESC const *, CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectDestroy)(CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc)(CUDA_RESOURCE_DESC *, CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc)(CUDA_TEXTURE_DESC *, CUtexObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate)(CUsurfObject *, CUDA_RESOURCE_DESC const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectDestroy)(CUsurfObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc)(CUDA_RESOURCE_DESC *, CUsurfObject); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer)(int *, CUdevice, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess)(CUcontext, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess)(CUcontext); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute)(int *, CUdevice_P2PAttribute, CUdevice, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnregisterResource)(CUgraphicsResource); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsSubResourceGetMappedArray)(CUarray *, CUgraphicsResource, unsigned int, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedMipmappedArray)(CUmipmappedArray *, CUgraphicsResource); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedPointer_v2)(CUdeviceptr *, size_t *, CUgraphicsResource); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceSetMapFlags_v2)(CUgraphicsResource, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsMapResources)(unsigned int, CUgraphicsResource *, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnmapResources)(unsigned int, CUgraphicsResource *, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress_v2)(char const *, void **, int, cuuint64_t, CUdriverProcAddressQueryResult *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable)(void const **, CUuuid const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStart)(void); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStop)(void); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsEGLRegisterImage)(CUgraphicsResource *, __pyx_t_4cuda_5ccuda_EGLImageKHR, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnect)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnectWithFlags)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerDisconnect)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerAcquireFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, CUgraphicsResource *, CUstream *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerReleaseFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, CUgraphicsResource, CUstream *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerConnect)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR, __pyx_t_4cuda_5ccuda_EGLint, __pyx_t_4cuda_5ccuda_EGLint); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerDisconnect)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame, CUstream *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame)(__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame *, CUstream *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame)(__pyx_t_4cuda_5ccuda_CUeglFrame *, CUgraphicsResource, unsigned int, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreateFromEGLSync)(CUevent *, __pyx_t_4cuda_5ccuda_EGLSyncKHR, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterBuffer)(CUgraphicsResource *, __pyx_t_4cuda_5ccuda_GLuint, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterImage)(CUgraphicsResource *, __pyx_t_4cuda_5ccuda_GLuint, __pyx_t_4cuda_5ccuda_GLenum, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGLGetDevices_v2)(unsigned int *, CUdevice *, unsigned int, __pyx_t_4cuda_5ccuda_CUGLDeviceList); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuVDPAUGetDevice)(CUdevice *, __pyx_t_4cuda_5ccuda_VdpDevice, __pyx_t_4cuda_5ccuda_VdpGetProcAddress *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterVideoSurface)(CUgraphicsResource *, __pyx_t_4cuda_5ccuda_VdpVideoSurface, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterOutputSurface)(CUgraphicsResource *, __pyx_t_4cuda_5ccuda_VdpOutputSurface, unsigned int); /*proto*/

/* Module declarations from "cuda._lib.ccudart.utils" */
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext)(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext)(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *); /*proto*/
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *(*__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance)(void); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError)(cudaError_t); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo)(struct cudaChannelFormatDesc const *, int *, CUarray_format *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon)(cudaStream_t, cudaStreamCallback_t, void *, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon)(cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc)(struct cudaChannelFormatDesc *, size_t *, size_t *, size_t *, CUDA_ARRAY3D_DESCRIPTOR_v2 const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc)(cudaArray_const_t, struct cudaChannelFormatDesc *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc)(CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *, CUDA_TEXTURE_DESC *, struct cudaTextureDesc const *, CUDA_RESOURCE_VIEW_DESC *, struct cudaResourceViewDesc const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc)(struct cudaResourceDesc *, CUDA_RESOURCE_DESC const *, struct cudaTextureDesc *, CUDA_TEXTURE_DESC const *, struct cudaResourceViewDesc *, CUDA_RESOURCE_VIEW_DESC const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams)(void *, void const *, size_t, enum cudaMemcpyKind, struct cudaMemcpy3DParms *); /*proto*/
static void (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams)(struct cudaMemsetParams const *, CUDA_MEMSET_NODE_PARAMS *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams)(struct cudaMemcpy3DParms const *, CUDA_MEMCPY3D *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray)(cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, int, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray)(cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch)(void *, void const *, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost)(size_t, void **, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch)(size_t, size_t, size_t, void **, size_t *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray)(cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, unsigned int, unsigned int); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr)(char *, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D)(struct cudaMemcpy3DParms const *, bool, int, int, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch)(void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams)(CUDA_MEMCPY3D_v2 const *, struct cudaMemcpy3DParms *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray)(char *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray)(cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr)(struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray)(cudaArray_t, size_t, size_t, char const *, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray)(char *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray)(cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc)(CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame)(__pyx_t_4cuda_5ccuda_CUeglFrame *, __pyx_t_4cuda_7ccudart_cudaEglFrame); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame)(__pyx_t_4cuda_7ccudart_cudaEglFrame *, __pyx_t_4cuda_5ccuda_CUeglFrame); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams)(struct cudaGraphNodeParams const *, CUgraphNodeParams *); /*proto*/
static void (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams)(CUgraphNodeParams const *, struct cudaGraphNodeParams *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams)(struct cudaKernelNodeParams const *, CUDA_KERNEL_NODE_PARAMS *); /*proto*/
static void (*__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams)(struct cudaHostNodeParams const *, CUDA_HOST_NODE_PARAMS *); /*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;
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithFlags(cudaGraphExec_t *, cudaGraph_t, unsigned PY_LONG_LONG); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#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" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_range;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = "?";
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";
/* #### Code section: decls ### */
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyObject *__pyx_n_s_;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_test;
} __pyx_mstate;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal);
  Py_CLEAR(clear_module_state->__pyx_n_s_);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal);
  Py_VISIT(traverse_module_state->__pyx_n_s_);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal __pyx_mstate_global->__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
/* #### Code section: module_code ### */

/* "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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":30
 * 
 * cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":42
 * 
 * cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":56
 *     cdef cudaError_t err = cudaSuccess
 *     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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuEventQuery(<ccuda.CUevent>event)
 */

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

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

static struct cudaChannelFormatDesc __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateChannelDesc(int __pyx_v_x, int __pyx_v_y, int __pyx_v_z, int __pyx_v_w, enum cudaChannelFormatKind __pyx_v_f) {
  struct cudaChannelFormatDesc __pyx_v_desc;
  struct cudaChannelFormatDesc __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __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:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateChannelDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":72
 * 
 * cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":74
 *     cdef cudaError_t err = cudaSuccess
 *     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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDriverGetVersion(driverVersion)
 */

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":81
 * cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     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 = cudaSuccess
 *     runtimeVersion[0] = m_global._CUDART_VERSION
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaRuntimeGetVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if fmtDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetTexture1DLinearMaxWidth(size_t *__pyx_v_maxWidthInElements, struct cudaChannelFormatDesc const *__pyx_v_fmtDesc, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUarray_format __pyx_v_fmt;
  int __pyx_v_numChannels;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if fmtDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_fmtDesc == NULL);
  if (__pyx_t_1) {

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":90
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUarray_format fmt
 *     cdef int numChannels = 0
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetTexture1DLinearMaxWidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if ptr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocHost(void **__pyx_v_ptr, size_t __pyx_v_size) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if ptr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":112
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if devPtr == NULL or pitch == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocPitch(void **__pyx_v_devPtr, size_t *__pyx_v_pitch, size_t __pyx_v_width, size_t __pyx_v_height) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if devPtr == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_devPtr == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_pitch == NULL);
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if devPtr == NULL or pitch == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":126
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocPitch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if mipmappedArray == NULL or desc == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmappedArray, struct cudaChannelFormatDesc const *__pyx_v_desc, struct cudaExtent __pyx_v_extent, unsigned int __pyx_v_numLevels, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL or desc == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_mipmappedArray == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_desc == NULL);
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL or desc == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":140
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

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

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

  /* "cuda/_lib/ccudart/ccudart.pyx":163
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy2DAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

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

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 */

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

  /* "cuda/_lib/ccudart/ccudart.pyx":189
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pCopyParams == NULL:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":219
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaMemcpy3DParms copyParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":246
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaMemcpy3DParms copyParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":267
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pNodeParams == NULL:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":297
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaMemcpy3DParms copyParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":322
 * 
 * cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGetProcAddress_v2(symbol, funcPtr, m_global._CUDART_VERSION, flags, <ccuda.CUdriverProcAddressQueryResult*>driverStatus)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":332
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pMemsetParams == NULL:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":358
 *     cdef ccuda.CUcontext context
 *     cdef ccuda.CUDA_MEMSET_NODE_PARAMS driverParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pNodeParams == NULL:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":383
 * cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef ccuda.CUDA_MEMCPY3D_v2 driverNodeParams
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pNodeParams == NULL:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":409
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":431
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef int bytes = 0             # <<<<<<<<<<<<<<
 *     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)
 */
  __pyx_v_bytes = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":486
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":500
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":518
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":530
 * cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil:
 *     cdef const char* pStr = NULL
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuGetErrorString(<ccuda.CUresult>error, &pStr)
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":541
 * 
 * cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/_lib/ccudart/ccudart.pyx":552
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo_v2(cudaStream_t __pyx_v_stream, enum cudaStreamCaptureStatus *__pyx_v_captureStatus_out, unsigned PY_LONG_LONG *__pyx_v_id_out, cudaGraph_t *__pyx_v_graph_out, cudaGraphNode_t const **__pyx_v_dependencies_out, size_t *__pyx_v_numDependencies_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamGetCaptureInfo_v2", __pyx_f[0], 552, 1, __PYX_ERR(0, 552, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":553
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":556
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":557
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":556
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":558
 *     if err != cudaSuccess:
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon(__pyx_v_stream, __pyx_v_captureStatus_out, __pyx_v_id_out, __pyx_v_graph_out, __pyx_v_dependencies_out, __pyx_v_numDependencies_out); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 558, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":559
 *         return err
 *     err = streamGetCaptureInfoCommon(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":552
 * 
 * 
 * cdef cudaError_t _cudaStreamGetCaptureInfo_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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":564
 * 
 * 
 * cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalSemaphore(cudaExternalSemaphore_t *__pyx_v_extSem_out, struct cudaExternalSemaphoreHandleDesc const *__pyx_v_semHandleDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC __pyx_v_driverSemHandleDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_t_3;
  void *__pyx_t_4;
  void const *__pyx_t_5;
  void const *__pyx_t_6;
  unsigned int __pyx_t_7;
  CUresult __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaImportExternalSemaphore", __pyx_f[0], 564, 1, __PYX_ERR(0, 564, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":565
 * 
 * cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":568
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 *     if semHandleDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_semHandleDesc == NULL);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":570
 *     if semHandleDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":568
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 * 
 *     if semHandleDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":572
 *         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":574
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
  switch (__pyx_v_semHandleDesc->type) {
    case cudaExternalSemaphoreHandleTypeOpaqueFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":575
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":576
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 */
    __pyx_t_3 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":574
 *     memset(&driverSemHandleDesc, 0, sizeof(driverSemHandleDesc))
 * 
 *     if semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
    break;
    case cudaExternalSemaphoreHandleTypeOpaqueWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":578
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":579
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":580
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":577
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":582
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":583
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":584
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":581
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeD3D12Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":586
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":587
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":588
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":585
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeD3D11Fence:

    /* "cuda/_lib/ccudart/ccudart.pyx":590
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":591
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":592
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":589
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeNvSciSync:

    /* "cuda/_lib/ccudart/ccudart.pyx":594
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC;

    /* "cuda/_lib/ccudart/ccudart.pyx":595
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 */
    __pyx_t_6 = __pyx_v_semHandleDesc->handle.nvSciSyncObj;
    __pyx_v_driverSemHandleDesc.handle.nvSciSyncObj = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":593
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 */
    break;
    case cudaExternalSemaphoreHandleTypeKeyedMutex:

    /* "cuda/_lib/ccudart/ccudart.pyx":597
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX;

    /* "cuda/_lib/ccudart/ccudart.pyx":598
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":599
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":596
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC
 *         driverSemHandleDesc.handle.nvSciSyncObj = semHandleDesc.handle.nvSciSyncObj
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeKeyedMutexKmt:

    /* "cuda/_lib/ccudart/ccudart.pyx":601
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":602
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":603
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":600
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 */
    break;
    case cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:

    /* "cuda/_lib/ccudart/ccudart.pyx":605
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":606
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd             # <<<<<<<<<<<<<<
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 */
    __pyx_t_3 = __pyx_v_semHandleDesc->handle.fd;
    __pyx_v_driverSemHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":604
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd:             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 */
    break;
    case cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:

    /* "cuda/_lib/ccudart/ccudart.pyx":608
 *         driverSemHandleDesc.handle.fd = semHandleDesc.handle.fd
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 */
    __pyx_v_driverSemHandleDesc.type = CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":609
 *     elif semHandleDesc.type == cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32:
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle             # <<<<<<<<<<<<<<
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 */
    __pyx_t_4 = __pyx_v_semHandleDesc->handle.win32.handle;
    __pyx_v_driverSemHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":610
 *         driverSemHandleDesc.type =  ccuda.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name             # <<<<<<<<<<<<<<
 *     driverSemHandleDesc.flags = semHandleDesc.flags
 * 
 */
    __pyx_t_5 = __pyx_v_semHandleDesc->handle.win32.name;
    __pyx_v_driverSemHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":607
 *         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":611
 *         driverSemHandleDesc.handle.win32.handle = semHandleDesc.handle.win32.handle
 *         driverSemHandleDesc.handle.win32.name = semHandleDesc.handle.win32.name
 *     driverSemHandleDesc.flags = semHandleDesc.flags             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_t_7 = __pyx_v_semHandleDesc->flags;
  __pyx_v_driverSemHandleDesc.flags = __pyx_t_7;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":614
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":615
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":614
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":616
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_8 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore(((CUexternalSemaphore *)__pyx_v_extSem_out), (&__pyx_v_driverSemHandleDesc)); if (unlikely(__pyx_t_8 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 616, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_8);

  /* "cuda/_lib/ccudart/ccudart.pyx":617
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalSemaphore(<ccuda.CUexternalSemaphore *>extSem_out, &driverSemHandleDesc)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != ((cudaError_t)cudaSuccess));
  if (__pyx_t_1) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":564
 * 
 * 
 * cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC driverSemHandleDesc
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":622
 * 
 * 
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync_v2(cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct cudaExternalSemaphoreSignalParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaSignalExternalSemaphoresAsync_v2", __pyx_f[0], 622, 1, __PYX_ERR(0, 622, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":623
 * 
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":624
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 624, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":625
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":626
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":625
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":627
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync(((CUexternalSemaphore const *)__pyx_v_extSemArray), ((CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 627, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":628
 *         return err
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":629
 *     err = <cudaError_t>ccuda._cuSignalExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 629, __pyx_L1_error)

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":622
 * 
 * 
 * cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":634
 * 
 * 
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync_v2(cudaExternalSemaphore_t const *__pyx_v_extSemArray, struct cudaExternalSemaphoreWaitParams const *__pyx_v_paramsArray, unsigned int __pyx_v_numExtSems, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaWaitExternalSemaphoresAsync_v2", __pyx_f[0], 634, 1, __PYX_ERR(0, 634, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":635
 * 
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":636
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 636, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":637
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":638
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":637
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":639
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync(((CUexternalSemaphore const *)__pyx_v_extSemArray), ((CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *)__pyx_v_paramsArray), __pyx_v_numExtSems, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 639, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":640
 *         return err
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":641
 *     err = <cudaError_t>ccuda._cuWaitExternalSemaphoresAsync(<const ccuda.CUexternalSemaphore *>extSemArray, <ccuda.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *>paramsArray, numExtSems, stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 641, __pyx_L1_error)

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

    /* "cuda/_lib/ccudart/ccudart.pyx":640
 *         return err
 *     err = <cudaError_t>ccuda._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":643
 *         _setLastError(err)
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":634
 * 
 * 
 * cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":646
 * 
 * 
 * cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo(struct cudaChannelFormatDesc *__pyx_v_desc, struct cudaExtent *__pyx_v_extent, unsigned int *__pyx_v_flags, cudaArray_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_driverDesc;
  size_t __pyx_v_width;
  size_t __pyx_v_height;
  size_t __pyx_v_depth;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  unsigned int __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaArrayGetInfo", __pyx_f[0], 646, 1, __PYX_ERR(0, 646, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":647
 * 
 * cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     cdef size_t width  = 0
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":649
 *     cdef cudaError_t err = cudaSuccess
 *     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":650
 *     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":651
 *     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":654
 * 
 *     # 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":655
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:
 *         flags[0] = 0             # <<<<<<<<<<<<<<
 * 
 *     if desc:
 */
    (__pyx_v_flags[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":654
 * 
 *     # Zero out parameters in case cuArray3DGetDescriptor fails
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = 0
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":657
 *         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":658
 * 
 *     if desc:
 *         memset(desc, 0, sizeof(desc[0]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (void)(memset(__pyx_v_desc, 0, (sizeof((__pyx_v_desc[0])))));

    /* "cuda/_lib/ccudart/ccudart.pyx":657
 *         flags[0] = 0
 * 
 *     if desc:             # <<<<<<<<<<<<<<
 *         memset(desc, 0, sizeof(desc[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":661
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  __pyx_t_1 = (__pyx_v_extent != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":662
 * 
 *     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":661
 * 
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":664
 *         memset(extent, 0, sizeof(extent[0]))
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err != <cudaError_t>cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2((&__pyx_v_driverDesc), ((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 664, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":665
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != ((cudaError_t)cudaSuccess));
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":667
 *     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":665
 * 
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":670
 * 
 *     # 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":671
 *     # Flags are copied directly from the driver API
 *     if flags:
 *         flags[0] = driverDesc.Flags             # <<<<<<<<<<<<<<
 * 
 *     # Convert from driver API types to runtime API types. extent.Depth = 0
 */
    __pyx_t_4 = __pyx_v_driverDesc.Flags;
    (__pyx_v_flags[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":670
 * 
 *     # Flags are copied directly from the driver API
 *     if flags:             # <<<<<<<<<<<<<<
 *         flags[0] = driverDesc.Flags
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":675
 *     # 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":676
 *     # indicates a 2D array.
 *     if desc:
 *         width  = 0             # <<<<<<<<<<<<<<
 *         height = 0
 *         depth  = 0
 */
    __pyx_v_width = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":677
 *     if desc:
 *         width  = 0
 *         height = 0             # <<<<<<<<<<<<<<
 *         depth  = 0
 * 
 */
    __pyx_v_height = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":678
 *         width  = 0
 *         height = 0
 *         depth  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 */
    __pyx_v_depth = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":680
 *         depth  = 0
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)             # <<<<<<<<<<<<<<
 *         if err != <cudaError_t>cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc(__pyx_v_desc, (&__pyx_v_depth), (&__pyx_v_height), (&__pyx_v_width), (&__pyx_v_driverDesc)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 680, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":681
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = (__pyx_v_err != ((cudaError_t)cudaSuccess));
    if (__pyx_t_1) {

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

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

      /* "cuda/_lib/ccudart/ccudart.pyx":681
 * 
 *         err = getChannelFormatDescFromDriverDesc(desc, &depth, &height, &width, &driverDesc)
 *         if err != <cudaError_t>cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":675
 *     # 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":685
 *             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":686
 * 
 *     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":687
 *     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":688
 *         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":685
 *             return err
 * 
 *     if extent:             # <<<<<<<<<<<<<<
 *         extent.width  = driverDesc.Width
 *         extent.height = driverDesc.Height
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":690
 *         extent.depth  = driverDesc.Depth
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":646
 * 
 * 
 * cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":693
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy2DToArray", __pyx_f[0], 693, 1, __PYX_ERR(0, 693, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":694
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":693
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":705
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray(void *__pyx_v_dst, size_t __pyx_v_dpitch, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy2DFromArray", __pyx_f[0], 705, 1, __PYX_ERR(0, 705, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":706
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":711
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray(((char *)__pyx_v_dst), __pyx_v_dpitch, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_width, __pyx_v_height, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 711, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":712
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":705
 * 
 * 
 * cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":717
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy2DArrayToArray", __pyx_f[0], 717, 1, __PYX_ERR(0, 717, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":718
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":721
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":722
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":721
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":723
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray(__pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_width, __pyx_v_height, __pyx_v_kind); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":724
 *         return err
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":725
 *     err = memcpy2DArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, width, height, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 725, __pyx_L1_error)

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

  /* "cuda/_lib/ccudart/ccudart.pyx":717
 * 
 * 
 * cdef cudaError_t _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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":729
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy2DToArrayAsync", __pyx_f[0], 729, 1, __PYX_ERR(0, 729, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":730
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":729
 * 
 * 
 * cdef cudaError_t _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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":741
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync(void *__pyx_v_dst, size_t __pyx_v_dpitch, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy2DFromArrayAsync", __pyx_f[0], 741, 1, __PYX_ERR(0, 741, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":742
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":747
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray(((char *)__pyx_v_dst), __pyx_v_dpitch, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_width, __pyx_v_height, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 747, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":748
 *         return err
 *     err = memcpy2DFromArray(<char*>dst, dpitch, src, hOffset, wOffset, width, height, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":741
 * 
 * 
 * cdef cudaError_t _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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":753
 * 
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D(struct cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct cudaExtent __pyx_v_extent) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemset3D", __pyx_f[0], 753, 1, __PYX_ERR(0, 753, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":754
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":757
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":758
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":757
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":759
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":760
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":761
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 761, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":760
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":753
 * 
 * 
 * cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":765
 * 
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync(struct cudaPitchedPtr __pyx_v_pitchedDevPtr, int __pyx_v_value, struct cudaExtent __pyx_v_extent, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemset3DAsync", __pyx_f[0], 765, 1, __PYX_ERR(0, 765, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":766
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":769
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":770
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":769
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":771
 *     if err != cudaSuccess:
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(__pyx_v_pitchedDevPtr, __pyx_v_value, __pyx_v_extent, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 771, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":772
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":773
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 773, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":772
 *         return err
 *     err = memset3DPtr(pitchedDevPtr, value, extent, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":765
 * 
 * 
 * cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":777
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyToArray", __pyx_f[0], 777, 1, __PYX_ERR(0, 777, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":778
 * 
 * cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":781
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":782
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":781
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":783
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_count, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 783, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":784
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":785
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 785, __pyx_L1_error)

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

  /* "cuda/_lib/ccudart/ccudart.pyx":777
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":789
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray(void *__pyx_v_dst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyFromArray", __pyx_f[0], 789, 1, __PYX_ERR(0, 789, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":790
 * 
 * cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":793
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":794
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":793
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":795
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray(((char *)__pyx_v_dst), __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_count, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 795, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":796
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, NULL, 0)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":789
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":801
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyToArrayAsync", __pyx_f[0], 801, 1, __PYX_ERR(0, 801, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":802
 * 
 * cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":805
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":806
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":805
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":807
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, ((char const *)__pyx_v_src), __pyx_v_count, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 807, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":808
 *         return err
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":809
 *     err = memcpyToArray(dst, hOffset, wOffset, <const char*>src, count, kind, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 809, __pyx_L1_error)

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

  /* "cuda/_lib/ccudart/ccudart.pyx":801
 * 
 * 
 * cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":813
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync(void *__pyx_v_dst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffset, size_t __pyx_v_hOffset, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyFromArrayAsync", __pyx_f[0], 813, 1, __PYX_ERR(0, 813, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":814
 * 
 * cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":817
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":818
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":817
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":819
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray(((char *)__pyx_v_dst), __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_count, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 819, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":820
 *         return err
 *     err = memcpyFromArray(<char*>dst, src, hOffset, wOffset, count, kind, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":813
 * 
 * 
 * cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":825
 * 
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPointerAttributes attrib
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes(struct cudaPointerAttributes *__pyx_v_attributes, void const *__pyx_v_ptr) {
  cudaError_t __pyx_v_err;
  struct cudaPointerAttributes __pyx_v_attrib;
  CUcontext __pyx_v_driverContext;
  CUmemorytype __pyx_v_driverMemoryType;
  int __pyx_v_isManaged;
  CUpointer_attribute __pyx_v_query[6];
  void **__pyx_v_data;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  void *__pyx_t_1[6];
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  CUresult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaPointerGetAttributes", __pyx_f[0], 825, 1, __PYX_ERR(0, 825, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":826
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaPointerAttributes attrib
 *     cdef ccuda.CUcontext driverContext = NULL
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":828
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPointerAttributes attrib
 *     cdef ccuda.CUcontext driverContext = NULL             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUmemorytype driverMemoryType
 *     cdef int isManaged = 0
 */
  __pyx_v_driverContext = NULL;

  /* "cuda/_lib/ccudart/ccudart.pyx":830
 *     cdef ccuda.CUcontext driverContext = NULL
 *     cdef ccuda.CUmemorytype driverMemoryType
 *     cdef int isManaged = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUpointer_attribute[6] query
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT
 */
  __pyx_v_isManaged = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":832
 *     cdef int isManaged = 0
 *     cdef ccuda.CUpointer_attribute[6] query
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT             # <<<<<<<<<<<<<<
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 */
  (__pyx_v_query[0]) = CU_POINTER_ATTRIBUTE_CONTEXT;

  /* "cuda/_lib/ccudart/ccudart.pyx":833
 *     cdef ccuda.CUpointer_attribute[6] query
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE             # <<<<<<<<<<<<<<
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 */
  (__pyx_v_query[1]) = CU_POINTER_ATTRIBUTE_MEMORY_TYPE;

  /* "cuda/_lib/ccudart/ccudart.pyx":834
 *     query[0] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER             # <<<<<<<<<<<<<<
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED
 */
  (__pyx_v_query[2]) = CU_POINTER_ATTRIBUTE_DEVICE_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":835
 *     query[1] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER             # <<<<<<<<<<<<<<
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 */
  (__pyx_v_query[3]) = CU_POINTER_ATTRIBUTE_HOST_POINTER;

  /* "cuda/_lib/ccudart/ccudart.pyx":836
 *     query[2] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER
 *     query[3] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER
 *     query[4] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED             # <<<<<<<<<<<<<<
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 * 
 */
  (__pyx_v_query[4]) = CU_POINTER_ATTRIBUTE_IS_MANAGED;

  /* "cuda/_lib/ccudart/ccudart.pyx":837
 *     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             # <<<<<<<<<<<<<<
 * 
 *     memset(&attrib, 0, sizeof(attrib))
 */
  (__pyx_v_query[5]) = CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL;

  /* "cuda/_lib/ccudart/ccudart.pyx":839
 *     query[5] = ccuda.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
 * 
 *     memset(&attrib, 0, sizeof(attrib))             # <<<<<<<<<<<<<<
 *     memset(&driverMemoryType, 0, sizeof(driverMemoryType))
 * 
 */
  (void)(memset((&__pyx_v_attrib), 0, (sizeof(__pyx_v_attrib))));

  /* "cuda/_lib/ccudart/ccudart.pyx":840
 * 
 *     memset(&attrib, 0, sizeof(attrib))
 *     memset(&driverMemoryType, 0, sizeof(driverMemoryType))             # <<<<<<<<<<<<<<
 * 
 *     cdef void** data = [
 */
  (void)(memset((&__pyx_v_driverMemoryType), 0, (sizeof(__pyx_v_driverMemoryType))));

  /* "cuda/_lib/ccudart/ccudart.pyx":842
 *     memset(&driverMemoryType, 0, sizeof(driverMemoryType))
 * 
 *     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":851
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = (__pyx_v_attributes == NULL);
  if (__pyx_t_2) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":853
 *     if attributes == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # Get all the attributes we need
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":851
 *     ]
 * 
 *     if attributes == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":856
 * 
 *     # Get all the attributes we need
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         if attributes != NULL:
 */
  __pyx_t_4 = (sizeof(__pyx_v_query));
  __pyx_t_5 = (sizeof((__pyx_v_query[0])));
  if (unlikely(__pyx_t_5 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 856, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes(((unsigned int)(((double)__pyx_t_4) / ((double)__pyx_t_5))), __pyx_v_query, __pyx_v_data, ((CUdeviceptr_v2)__pyx_v_ptr)); if (unlikely(__pyx_t_6 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 856, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_6);

  /* "cuda/_lib/ccudart/ccudart.pyx":857
 *     # Get all the attributes we need
 *     err = <cudaError_t>ccuda._cuPointerGetAttributes(<unsigned int>(sizeof(query)/sizeof(query[0])), query, data, <ccuda.CUdeviceptr_v2>ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         if attributes != NULL:
 *             memset(attributes, 0, sizeof(attributes[0]))
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":858
 *     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);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":859
 *     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":860
 *         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":858
 *     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":861
 *             memset(attributes, 0, sizeof(attributes[0]))
 *             attributes[0].device = -1
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 861, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":862
 *             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":857
 *     # 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":864
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
  switch (__pyx_v_driverMemoryType) {
    case CU_MEMORYTYPE_HOST:

    /* "cuda/_lib/ccudart/ccudart.pyx":865
 * 
 *     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":866
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 */
      __pyx_v_attrib.type = cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":865
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:
 *         if isManaged:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":868
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeHost             # <<<<<<<<<<<<<<
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 */
    /*else*/ {
      __pyx_v_attrib.type = cudaMemoryTypeHost;
    }
    __pyx_L6:;

    /* "cuda/_lib/ccudart/ccudart.pyx":864
 *         return err
 * 
 *     if driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    case CU_MEMORYTYPE_DEVICE:

    /* "cuda/_lib/ccudart/ccudart.pyx":870
 *             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":871
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged             # <<<<<<<<<<<<<<
 *         else:
 *             attrib.type = cudaMemoryTypeDevice
 */
      __pyx_v_attrib.type = cudaMemoryTypeManaged;

      /* "cuda/_lib/ccudart/ccudart.pyx":870
 *             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":873
 *             attrib.type = cudaMemoryTypeManaged
 *         else:
 *             attrib.type = cudaMemoryTypeDevice             # <<<<<<<<<<<<<<
 *     else:
 *          if driverMemoryType == 0:
 */
    /*else*/ {
      __pyx_v_attrib.type = cudaMemoryTypeDevice;
    }
    __pyx_L7:;

    /* "cuda/_lib/ccudart/ccudart.pyx":869
 *         else:
 *             attrib.type = cudaMemoryTypeHost
 *     elif driverMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE:             # <<<<<<<<<<<<<<
 *         if isManaged:
 *             attrib.type = cudaMemoryTypeManaged
 */
    break;
    default:

    /* "cuda/_lib/ccudart/ccudart.pyx":875
 *             attrib.type = cudaMemoryTypeDevice
 *     else:
 *          if driverMemoryType == 0:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 */
    __pyx_t_2 = (__pyx_v_driverMemoryType == 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":876
 *     else:
 *          if driverMemoryType == 0:
 *             attrib.type = cudaMemoryTypeUnregistered             # <<<<<<<<<<<<<<
 *          else:
 *             if attributes != NULL:
 */
      __pyx_v_attrib.type = cudaMemoryTypeUnregistered;

      /* "cuda/_lib/ccudart/ccudart.pyx":875
 *             attrib.type = cudaMemoryTypeDevice
 *     else:
 *          if driverMemoryType == 0:             # <<<<<<<<<<<<<<
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 */
      goto __pyx_L8;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":878
 *             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);
      if (__pyx_t_2) {

        /* "cuda/_lib/ccudart/ccudart.pyx":879
 *          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":880
 *             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":878
 *             attrib.type = cudaMemoryTypeUnregistered
 *          else:
 *             if attributes != NULL:             # <<<<<<<<<<<<<<
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 */
      }

      /* "cuda/_lib/ccudart/ccudart.pyx":881
 *                 memset(attributes, 0, sizeof(attributes[0]))
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 * 
 */
      __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 881, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":882
 *                 attributes[0].device = -1
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     # copy to user structure
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;
    }
    __pyx_L8:;
    break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":885
 * 
 *     # copy to user structure
 *     attributes[0] = attrib             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (__pyx_v_attributes[0]) = __pyx_v_attrib;

  /* "cuda/_lib/ccudart/ccudart.pyx":887
 *     attributes[0] = attrib
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":825
 * 
 * 
 * cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPointerAttributes attrib
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":890
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceFlags(unsigned int *__pyx_v_flags) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_driverContext;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  unsigned int __pyx_v_pcFlags;
  int __pyx_v_pcActive;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetDeviceFlags", __pyx_f[0], 890, 1, __PYX_ERR(0, 890, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":891
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":892
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 892, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":893
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":894
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     if flags == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":893
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":896
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = (__pyx_v_flags == NULL);
  if (__pyx_t_2) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":898
 *     if flags == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext driverContext
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":896
 *         return err
 * 
 *     if flags == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":907
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  __pyx_t_2 = (__pyx_v_driverContext != NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":908
 *     # Get the flags from the current context
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags(__pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 908, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/ccudart.pyx":909
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

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

      /* "cuda/_lib/ccudart/ccudart.pyx":909
 *     if driverContext != NULL:
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *         return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":911
 *         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":907
 * 
 *     # Get the flags from the current context
 *     if driverContext != NULL:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetFlags(flags)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":917
 *     cdef unsigned int pcFlags
 *     cdef int pcActive
 *     device = m_global.getDevice(0)             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, 0); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 917, __pyx_L1_error)
  __pyx_v_device = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":918
 *     cdef int pcActive
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState((__pyx_v_device[0]).driverDevice, (&__pyx_v_pcFlags), (&__pyx_v_pcActive)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 918, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":919
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":920
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 920, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":921
 *     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":919
 *     device = m_global.getDevice(0)
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxGetState(device[0].driverDevice, &pcFlags, &pcActive)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":922
 *         _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":923
 *         return err
 *     flags[0] = pcFlags | cudaDeviceMapHost
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":890
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":926
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3D(struct cudaMemcpy3DParms const *__pyx_v_p) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy3D", __pyx_f[0], 926, 1, __PYX_ERR(0, 926, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":927
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_p == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":928
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":927
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":930
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":932
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":933
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":932
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":934
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, NULL, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 934, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":935
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":935
 *         return err
 *     err = memcpy3D(p, False, 0, 0, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":926
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":940
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync(struct cudaMemcpy3DParms const *__pyx_v_p, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy3DAsync", __pyx_f[0], 940, 1, __PYX_ERR(0, 940, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":941
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_p == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":942
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":941
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":944
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":946
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":947
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":946
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":948
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(__pyx_v_p, 0, 0, 0, __pyx_v_stream, 1); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 948, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":949
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":949
 *         return err
 *     err = memcpy3D(p, False, 0, 0, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":940
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         return cudaErrorInvalidValue
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":954
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess(cudaMemPool_t __pyx_v_memPool, struct cudaMemAccessDesc const *__pyx_v_descList, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  size_t __pyx_v_MAX_DEVICES;
  CUmemAccessDesc __pyx_v_localList[32];
  CUmemAccessDesc *__pyx_v_cuDescList;
  size_t __pyx_v_i;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolSetAccess", __pyx_f[0], 954, 1, __PYX_ERR(0, 954, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":955
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":956
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 956, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":957
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":958
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t MAX_DEVICES = 32
 *     cdef ccuda.CUmemAccessDesc localList[32]
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":957
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t MAX_DEVICES = 32
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":959
 *     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":962
 *     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":964
 *     cdef size_t i = 0
 * 
 *     if (count > MAX_DEVICES):             # <<<<<<<<<<<<<<
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)
 *     else:
 */
  __pyx_t_2 = (__pyx_v_count > __pyx_v_MAX_DEVICES);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":965
 * 
 *     if (count > MAX_DEVICES):
 *         cuDescList = <ccuda.CUmemAccessDesc*>calloc(sizeof(ccuda.CUmemAccessDesc), count)             # <<<<<<<<<<<<<<
 *     else:
 *         cuDescList = localList
 */
    __pyx_v_cuDescList = ((CUmemAccessDesc *)calloc((sizeof(CUmemAccessDesc)), __pyx_v_count));

    /* "cuda/_lib/ccudart/ccudart.pyx":964
 *     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":967
 *         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":969
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  __pyx_t_2 = (__pyx_v_cuDescList == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":970
 * 
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorMemoryAllocation); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 970, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":971
 *     if cuDescList == NULL:
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     while i < count:
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":969
 *         cuDescList = localList
 * 
 *     if cuDescList == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorMemoryAllocation)
 *         return cudaErrorMemoryAllocation
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":973
 *         return cudaErrorMemoryAllocation
 * 
 *     while i < count:             # <<<<<<<<<<<<<<
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_i < __pyx_v_count);
    if (!__pyx_t_2) break;

    /* "cuda/_lib/ccudart/ccudart.pyx":974
 * 
 *     while i < count:
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type             # <<<<<<<<<<<<<<
 *         cuDescList[i].location.id = descList[i].location.id
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags
 */
    (__pyx_v_cuDescList[__pyx_v_i]).location.type = ((CUmemLocationType)(__pyx_v_descList[__pyx_v_i]).location.type);

    /* "cuda/_lib/ccudart/ccudart.pyx":975
 *     while i < count:
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id             # <<<<<<<<<<<<<<
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags
 *         i += 1
 */
    __pyx_t_3 = (__pyx_v_descList[__pyx_v_i]).location.id;
    (__pyx_v_cuDescList[__pyx_v_i]).location.id = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":976
 *         cuDescList[i].location.type = <ccuda.CUmemLocationType>descList[i].location.type
 *         cuDescList[i].location.id = descList[i].location.id
 *         cuDescList[i].flags = <ccuda.CUmemAccess_flags>descList[i].flags             # <<<<<<<<<<<<<<
 *         i += 1
 * 
 */
    (__pyx_v_cuDescList[__pyx_v_i]).flags = ((CUmemAccess_flags)(__pyx_v_descList[__pyx_v_i]).flags);

    /* "cuda/_lib/ccudart/ccudart.pyx":977
 *         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":979
 *         i += 1
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess(__pyx_v_memPool, __pyx_v_cuDescList, __pyx_v_count); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 979, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":980
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":980
 * 
 *     err = <cudaError_t>ccuda._cuMemPoolSetAccess(memPool, cuDescList, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":984
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  __pyx_t_2 = (__pyx_v_count > __pyx_v_MAX_DEVICES);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":985
 * 
 *     if count > MAX_DEVICES:
 *         free(cuDescList)             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    free(__pyx_v_cuDescList);

    /* "cuda/_lib/ccudart/ccudart.pyx":984
 *         return err
 * 
 *     if count > MAX_DEVICES:             # <<<<<<<<<<<<<<
 *         free(cuDescList)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":987
 *         free(cuDescList)
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":954
 * 
 * 
 * cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":990
 * 
 * 
 * cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceReset(void) {
  CYTHON_UNUSED int __pyx_v_deviceOrdinal;
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceReset", __pyx_f[0], 990, 1, __PYX_ERR(0, 990, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":991
 * 
 * cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if not m_global._lazyInitDriver:
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":992
 * cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if not m_global._lazyInitDriver:
 *         return cudaSuccess
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":993
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err = cudaSuccess
 *     if not m_global._lazyInitDriver:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = (!__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lazyInitDriver);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":994
 *     cdef cudaError_t err = cudaSuccess
 *     if not m_global._lazyInitDriver:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext context
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":993
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err = cudaSuccess
 *     if not m_global._lazyInitDriver:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

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

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

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

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

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1003
 * 
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1003, __pyx_L1_error)
  __pyx_v_device = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1004
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:             # <<<<<<<<<<<<<<
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = (__pyx_v_device != NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1005
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:
 *         err = resetPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1005, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1006
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *     return err
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

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

      /* "cuda/_lib/ccudart/ccudart.pyx":1006
 *     if device != NULL:
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *     return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1004
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device != NULL:             # <<<<<<<<<<<<<<
 *         err = resetPrimaryContext(device)
 *         if err != cudaSuccess:
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":990
 * 
 * 
 * cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaError_t err = cudaSuccess
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":1011
 * 
 * 
 * cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetLastError(void) {
  cudaError_t __pyx_v_last_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetLastError", __pyx_f[0], 1011, 1, __PYX_ERR(0, 1011, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1012
 * 
 * cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     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":1013
 * cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess             # <<<<<<<<<<<<<<
 *     return last_err
 * 
 */
  __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lastError = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1014
 *     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":1011
 * 
 * 
 * cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t last_err = m_global._lastError
 *     m_global._lastError = cudaSuccess
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":1017
 * 
 * 
 * cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return m_global._lastError
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPeekAtLastError(void) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaPeekAtLastError", __pyx_f[0], 1017, 1, __PYX_ERR(0, 1017, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1018
 * 
 * cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     return m_global._lastError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_lastError;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1017
 * 
 * 
 * cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return m_global._lastError
 * 
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":1021
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUdevice driverDevice = 0
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDevice(int *__pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  CUdevice __pyx_v_driverDevice;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_cudaDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetDevice", __pyx_f[0], 1021, 1, __PYX_ERR(0, 1021, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1022
 * 
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUdevice driverDevice = 0
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1023
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUdevice driverDevice = 0             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitDriver()
 */
  __pyx_v_driverDevice = 0;

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1027
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice *cudaDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1030
 * 
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice((&__pyx_v_driverDevice)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1030, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1031
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 */
  switch (__pyx_v_err) {
    case cudaSuccess:

    /* "cuda/_lib/ccudart/ccudart.pyx":1032
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)             # <<<<<<<<<<<<<<
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 *     elif err == cudaErrorDeviceUninitialized:
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_driverDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1032, __pyx_L1_error)
    __pyx_v_cudaDevice = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1033
 *     if err == cudaSuccess:
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal             # <<<<<<<<<<<<<<
 *     elif err == cudaErrorDeviceUninitialized:
 *         # Like C Runtime, default to first device and let context creation happen in another call
 */
    __pyx_t_5 = (__pyx_v_cudaDevice[0]).deviceOrdinal;
    (__pyx_v_deviceOrdinal[0]) = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1031
 *     cdef cudaPythonDevice *cudaDevice
 *     err = <cudaError_t>ccuda._cuCtxGetDevice(&driverDevice)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 */
    break;
    case cudaErrorDeviceUninitialized:

    /* "cuda/_lib/ccudart/ccudart.pyx":1037
 *         # Like C Runtime, default to first device and let context creation happen in another call
 *         # By default, device 0 would initialized
 *         deviceOrdinal[0] = 0             # <<<<<<<<<<<<<<
 *         err = cudaSuccess
 *     return err
 */
    (__pyx_v_deviceOrdinal[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1038
 *         # By default, device 0 would initialized
 *         deviceOrdinal[0] = 0
 *         err = cudaSuccess             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_v_err = cudaSuccess;

    /* "cuda/_lib/ccudart/ccudart.pyx":1034
 *         cudaDevice = m_global.getDeviceFromDriver(driverDevice)
 *         deviceOrdinal[0] = cudaDevice[0].deviceOrdinal
 *     elif err == cudaErrorDeviceUninitialized:             # <<<<<<<<<<<<<<
 *         # Like C Runtime, default to first device and let context creation happen in another call
 *         # By default, device 0 would initialized
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1039
 *         deviceOrdinal[0] = 0
 *         err = cudaSuccess
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1021
 * 
 * 
 * cdef cudaError_t _cudaGetDevice(int* deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUdevice driverDevice = 0
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":1042
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDevice(int __pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaSetDevice", __pyx_f[0], 1042, 1, __PYX_ERR(0, 1042, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1043
 * 
 * cdef cudaError_t _cudaSetDevice(int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *device
 * 
 */
  __pyx_v_err = cudaSuccess;

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

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1048
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1050
 *         return err
 * 
 *     device = m_global.getDevice(deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         _setLastError(err)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_deviceOrdinal); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1050, __pyx_L1_error)
  __pyx_v_device = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1051
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = (__pyx_v_device == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1052
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1052, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1053
 *     if device == NULL:
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     if device.primaryContext == NULL:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1051
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1055
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  __pyx_t_2 = (__pyx_v_device->primaryContext == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1056
 * 
 *     if device.primaryContext == NULL:
 *         initPrimaryContext(device)             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1056, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1055
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1058
 *         initPrimaryContext(device)
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent(__pyx_v_device->primaryContext); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1058, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1059
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

    /* "cuda/_lib/ccudart/ccudart.pyx":1059
 * 
 *     err = <cudaError_t>ccuda._cuCtxSetCurrent(device.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/ccudart.pyx":1042
 * 
 * 
 * cdef cudaError_t _cudaSetDevice(int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

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

/* "cuda/_lib/ccudart/ccudart.pyx":1064
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceProperties_v2(struct cudaDeviceProp *__pyx_v_prop, int __pyx_v_deviceOrdinal) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  CUresult __pyx_t_4;
  struct cudaDeviceProp __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetDeviceProperties_v2", __pyx_f[0], 1064, 1, __PYX_ERR(0, 1064, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1065
 * 
 * cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1066
 * cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1066, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1067
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1068
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1067
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1070
 *         return err
 * 
 *     device = m_global.getDevice(deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         _setLastError(err)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_deviceOrdinal); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_v_device = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1071
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = (__pyx_v_device == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1072
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1072, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1073
 *     if device == NULL:
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1071
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1075
 *         return cudaErrorInvalidDevice
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.kernelExecTimeoutEnabled), CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1075, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1076
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1077
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1077, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1078
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1076
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled),  ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1080
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.computeMode), CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1080, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1081
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1082
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1082, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1083
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1081
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computeMode),  ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1085
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.clockRate), CU_DEVICE_ATTRIBUTE_CLOCK_RATE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1085, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1086
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1087
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1087, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1088
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1086
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1090
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.memoryClockRate), CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1090, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1091
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1092
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1092, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1093
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1091
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1095
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.singleToDoublePrecisionPerfRatio), CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1095, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1096
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1097
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1097, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1098
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     prop[0] = device[0].deviceProperties
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1096
 * 
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, device[0].driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1100
 *         return err
 * 
 *     prop[0] = device[0].deviceProperties             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  __pyx_t_5 = (__pyx_v_device[0]).deviceProperties;
  (__pyx_v_prop[0]) = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1102
 *     prop[0] = device[0].deviceProperties
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1064
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDeviceProperties_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1105
 * 
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice(int *__pyx_v_device, struct cudaDeviceProp const *__pyx_v_prop) {
  cudaError_t __pyx_v_err;
  int __pyx_v_best;
  int __pyx_v_maxrank;
  int __pyx_v_rank;
  char *__pyx_v_dontCare_name;
  int __pyx_v_dontCare_major;
  int __pyx_v_dontCare_minor;
  size_t __pyx_v_dontCare_totalGlobalMem;
  int __pyx_v_deviceOrdinal;
  struct cudaDeviceProp *__pyx_v_devProp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  char __pyx_t_4[1];
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaChooseDevice", __pyx_f[0], 1105, 1, __PYX_ERR(0, 1105, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1106
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if device == NULL or prop == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = (__pyx_v_device == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_prop == NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1107
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1107, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1108
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1106
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if device == NULL or prop == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1110
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1111
 * 
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1111, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1112
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1113
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef int best = -1
 *     cdef int maxrank = -1
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1112
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef int best = -1
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1114
 *     if err != cudaSuccess:
 *         return err
 *     cdef int best = -1             # <<<<<<<<<<<<<<
 *     cdef int maxrank = -1
 *     cdef int rank = 0
 */
  __pyx_v_best = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1115
 *         return err
 *     cdef int best = -1
 *     cdef int maxrank = -1             # <<<<<<<<<<<<<<
 *     cdef int rank = 0
 *     cdef char* dontCare_name = [b'\0']
 */
  __pyx_v_maxrank = -1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1116
 *     cdef int best = -1
 *     cdef int maxrank = -1
 *     cdef int rank = 0             # <<<<<<<<<<<<<<
 *     cdef char* dontCare_name = [b'\0']
 *     cdef int dontCare_major = -1
 */
  __pyx_v_rank = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1117
 *     cdef int maxrank = -1
 *     cdef int rank = 0
 *     cdef char* dontCare_name = [b'\0']             # <<<<<<<<<<<<<<
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1
 */
  __pyx_t_4[0] = '\x00';
  __pyx_v_dontCare_name = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1118
 *     cdef int rank = 0
 *     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":1119
 *     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":1120
 *     cdef int dontCare_major = -1
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0             # <<<<<<<<<<<<<<
 *     cdef int deviceOrdinal = 0
 *     cdef cudaDeviceProp *devProp
 */
  __pyx_v_dontCare_totalGlobalMem = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1121
 *     cdef int dontCare_minor = -1
 *     cdef size_t dontCare_totalGlobalMem = 0
 *     cdef int deviceOrdinal = 0             # <<<<<<<<<<<<<<
 *     cdef cudaDeviceProp *devProp
 * 
 */
  __pyx_v_deviceOrdinal = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1124
 *     cdef cudaDeviceProp *devProp
 * 
 *     for deviceOrdinal in range(m_global._numDevices):             # <<<<<<<<<<<<<<
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 */
  __pyx_t_5 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_7;

    /* "cuda/_lib/ccudart/ccudart.pyx":1125
 * 
 *     for deviceOrdinal in range(m_global._numDevices):
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties             # <<<<<<<<<<<<<<
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 */
    __pyx_v_devProp = (&(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_deviceList[__pyx_v_deviceOrdinal]).deviceProperties);

    /* "cuda/_lib/ccudart/ccudart.pyx":1126
 *     for deviceOrdinal in range(m_global._numDevices):
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0             # <<<<<<<<<<<<<<
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 */
    __pyx_v_rank = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1127
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 */
    __pyx_t_1 = (strncmp((__pyx_v_prop[0]).name, __pyx_v_dontCare_name, (sizeof((__pyx_v_prop[0]).name))) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1128
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0             # <<<<<<<<<<<<<<
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 */
      __pyx_v_rank = (__pyx_v_rank + (strncmp((__pyx_v_prop[0]).name, (__pyx_v_devProp[0]).name, (sizeof((__pyx_v_prop[0]).name))) == 0));

      /* "cuda/_lib/ccudart/ccudart.pyx":1127
 *         devProp = &m_global._deviceList[deviceOrdinal].deviceProperties
 *         rank = 0
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):             # <<<<<<<<<<<<<<
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1129
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 */
    __pyx_t_1 = ((__pyx_v_prop[0]).major != __pyx_v_dontCare_major);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1130
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major             # <<<<<<<<<<<<<<
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).major <= (__pyx_v_devProp[0]).major));

      /* "cuda/_lib/ccudart/ccudart.pyx":1129
 *         if (strncmp(prop[0].name, dontCare_name, sizeof(prop[0].name)) != 0):
 *             rank += strncmp(prop[0].name, devProp[0].name, sizeof(prop[0].name)) == 0
 *         if (prop[0].major != dontCare_major):             # <<<<<<<<<<<<<<
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1131
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    __pyx_t_2 = ((__pyx_v_prop[0]).major == (__pyx_v_devProp[0]).major);
    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);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1132
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor             # <<<<<<<<<<<<<<
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).minor <= (__pyx_v_devProp[0]).minor));

      /* "cuda/_lib/ccudart/ccudart.pyx":1131
 *         if (prop[0].major != dontCare_major):
 *             rank += prop[0].major <= devProp[0].major
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):             # <<<<<<<<<<<<<<
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1133
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 */
    __pyx_t_1 = ((__pyx_v_prop[0]).totalGlobalMem != __pyx_v_dontCare_totalGlobalMem);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1134
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem             # <<<<<<<<<<<<<<
 *         if (rank > maxrank):
 *             maxrank = rank
 */
      __pyx_v_rank = (__pyx_v_rank + ((__pyx_v_prop[0]).totalGlobalMem <= (__pyx_v_devProp[0]).totalGlobalMem));

      /* "cuda/_lib/ccudart/ccudart.pyx":1133
 *         if (prop[0].major == devProp[0].major and prop[0].minor != dontCare_minor):
 *             rank += prop[0].minor <= devProp[0].minor
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):             # <<<<<<<<<<<<<<
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1135
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):             # <<<<<<<<<<<<<<
 *             maxrank = rank
 *             best = deviceOrdinal
 */
    __pyx_t_1 = (__pyx_v_rank > __pyx_v_maxrank);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1136
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):
 *             maxrank = rank             # <<<<<<<<<<<<<<
 *             best = deviceOrdinal
 * 
 */
      __pyx_v_maxrank = __pyx_v_rank;

      /* "cuda/_lib/ccudart/ccudart.pyx":1137
 *         if (rank > maxrank):
 *             maxrank = rank
 *             best = deviceOrdinal             # <<<<<<<<<<<<<<
 * 
 *     device[0] = best
 */
      __pyx_v_best = __pyx_v_deviceOrdinal;

      /* "cuda/_lib/ccudart/ccudart.pyx":1135
 *         if (prop[0].totalGlobalMem != dontCare_totalGlobalMem):
 *             rank += prop[0].totalGlobalMem <= devProp[0].totalGlobalMem
 *         if (rank > maxrank):             # <<<<<<<<<<<<<<
 *             maxrank = rank
 *             best = deviceOrdinal
 */
    }
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1139
 *             best = deviceOrdinal
 * 
 *     device[0] = best             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_device[0]) = __pyx_v_best;

  /* "cuda/_lib/ccudart/ccudart.pyx":1140
 * 
 *     device[0] = best
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1105
 * 
 * 
 * cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if device == NULL or prop == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaChooseDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1143
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_hOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyArrayToArray", __pyx_f[0], 1143, 1, __PYX_ERR(0, 1143, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1144
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1146
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1146, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1147
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1148
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1147
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1149
 *     if err != cudaSuccess:
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray(__pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_count, __pyx_v_kind); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1149, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1150
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1151
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1151, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1150
 *         return err
 *     err = memcpyArrayToArray(dst, hOffsetDst, wOffsetDst, src, hOffsetSrc, wOffsetSrc, count, kind)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1152
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1143
 * 
 * 
 * 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) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyArrayToArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1155
 * 
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc(struct cudaChannelFormatDesc *__pyx_v_desc, cudaArray_const_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetChannelDesc", __pyx_f[0], 1155, 1, __PYX_ERR(0, 1155, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1156
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if desc == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1158
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_desc == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1159
 * 
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1159, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1160
 *     if desc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1158
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if desc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1162
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1162, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1163
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1164
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1163
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelDesc(array, desc)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1165
 *     if err != cudaSuccess:
 *         return err
 *     err = getChannelDesc(array, desc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc(__pyx_v_array, __pyx_v_desc); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1165, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1166
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1167
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1167, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1166
 *         return err
 *     err = getChannelDesc(array, desc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1168
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1155
 * 
 * 
 * cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetChannelDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1171
 * 
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject(cudaTextureObject_t *__pyx_v_pTexObject, struct cudaResourceDesc const *__pyx_v_pResDesc, struct cudaTextureDesc const *__pyx_v_pTexDesc, struct cudaResourceViewDesc const *__pyx_v_pResViewDesc) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  struct cudaTextureDesc __pyx_v_texDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaCreateTextureObject", __pyx_f[0], 1171, 1, __PYX_ERR(0, 1171, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1172
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1174
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = (__pyx_v_pResDesc == NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_pTexDesc == NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1175
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1175, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1176
 *     if pResDesc == NULL or pTexDesc == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUDA_RESOURCE_DESC rd
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1174
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if pResDesc == NULL or pTexDesc == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1182
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 *     cdef cudaTextureDesc texDesc
 *     memcpy(&texDesc, pTexDesc, sizeof(cudaTextureDesc))             # <<<<<<<<<<<<<<
 *     texDesc.seamlessCubemap = 0
 * 
 */
  (void)(memcpy((&__pyx_v_texDesc), __pyx_v_pTexDesc, (sizeof(struct cudaTextureDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1183
 *     cdef cudaTextureDesc texDesc
 *     memcpy(&texDesc, pTexDesc, sizeof(cudaTextureDesc))
 *     texDesc.seamlessCubemap = 0             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_texDesc.seamlessCubemap = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1185
 *     texDesc.seamlessCubemap = 0
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1185, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1186
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1187
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1186
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1188
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_pResViewDesc != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1189
 *         return err
 *     if pResViewDesc:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)             # <<<<<<<<<<<<<<
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), (&__pyx_v_texDesc), (&__pyx_v_rvd), __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1189, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1188
 *     if err != cudaSuccess:
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1191
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, &rvd, pResViewDesc)
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc((&__pyx_v_rd), __pyx_v_pResDesc, (&__pyx_v_td), (&__pyx_v_texDesc), NULL, __pyx_v_pResViewDesc); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1191, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;
  }
  __pyx_L7:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1192
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1193
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if pResViewDesc:
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1193, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1194
 *     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":1192
 *     else:
 *         err = getDriverResDescFromResDesc(&rd, pResDesc, &td, &texDesc, NULL, pResViewDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1195
 *         _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":1196
 *         return err
 *     if pResViewDesc:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)             # <<<<<<<<<<<<<<
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), (&__pyx_v_rvd)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1196, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":1195
 *         _setLastError(err)
 *         return err
 *     if pResViewDesc:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1198
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, &rvd)
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  /*else*/ {
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate(__pyx_v_pTexObject, (&__pyx_v_rd), (&__pyx_v_td), NULL); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1198, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);
  }
  __pyx_L9:;

  /* "cuda/_lib/ccudart/ccudart.pyx":1199
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1200
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1200, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1199
 *     else:
 *         err = <cudaError_t>ccuda._cuTexObjectCreate(pTexObject, &rd, &td, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1201
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1171
 * 
 * 
 * cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateTextureObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1203
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *__pyx_v_pTexDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  struct cudaResourceDesc __pyx_v_resDesc;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_TEXTURE_DESC __pyx_v_td;
  struct cudaTextureDesc __pyx_v_texDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetTextureObjectTextureDesc", __pyx_f[0], 1203, 1, __PYX_ERR(0, 1203, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1204
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaResourceDesc resDesc
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1211
 *     cdef cudaTextureDesc texDesc
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1211, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1212
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1213
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1212
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1214
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1214, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1215
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1216
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1216, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1217
 *     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":1215
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1218
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc((&__pyx_v_td), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1218, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1219
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1220
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1220, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1221
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1219
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectGetTextureDesc(&td, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1222
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), (&__pyx_v_texDesc), (&__pyx_v_td), NULL, NULL); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1222, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1223
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1224
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1224, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1225
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1223
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, &texDesc, &td, NULL, NULL)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1226
 *         _setLastError(err)
 *         return err
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (void)(memcpy(__pyx_v_pTexDesc, (&__pyx_v_texDesc), (sizeof(struct cudaTextureDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1228
 *     memcpy(pTexDesc, &texDesc, sizeof(cudaTextureDesc))
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1203
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectTextureDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1230
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaResourceDesc resDesc
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *__pyx_v_pResViewDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  struct cudaResourceDesc __pyx_v_resDesc;
  CUDA_RESOURCE_DESC __pyx_v_rd;
  CUDA_RESOURCE_VIEW_DESC __pyx_v_rvd;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetTextureObjectResourceViewDesc", __pyx_f[0], 1230, 1, __PYX_ERR(0, 1230, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1231
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaResourceDesc resDesc
 *     cdef ccuda.CUDA_RESOURCE_DESC rd
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1236
 *     cdef ccuda.CUDA_RESOURCE_VIEW_DESC rvd
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1236, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1237
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1238
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1237
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1239
 *     if err != cudaSuccess:
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc((&__pyx_v_rd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1239, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1240
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1241
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1241, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1242
 *     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":1240
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceDesc(&rd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1243
 *         _setLastError(err)
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc((&__pyx_v_rvd), __pyx_v_texObject); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1243, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1244
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1245
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1245, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1246
 *     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":1244
 *         return err
 *     err =  <cudaError_t>ccuda.cuTexObjectGetResourceViewDesc(&rvd, texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1247
 *         _setLastError(err)
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc((&__pyx_v_resDesc), (&__pyx_v_rd), NULL, NULL, __pyx_v_pResViewDesc, (&__pyx_v_rvd)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1247, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1248
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1249
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1249, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1250
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1248
 *         return err
 *     err = getResDescFromDriverResDesc(&resDesc, &rd, NULL, NULL, pResViewDesc, &rvd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1252
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1230
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaResourceDesc resDesc
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectResourceViewDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1255
 * 
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable(void const **__pyx_v_ppExportTable, cudaUUID_t const *__pyx_v_pExportTableId) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetExportTable", __pyx_f[0], 1255, 1, __PYX_ERR(0, 1255, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1256
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitDriver()
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1258
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1258, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1259
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1260
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1259
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1261
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable(__pyx_v_ppExportTable, ((CUuuid const *)__pyx_v_pExportTableId)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1261, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1262
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1263
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1263, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1262
 *         return err
 *     err = <cudaError_t>ccuda._cuGetExportTable(ppExportTable, <const ccuda.CUuuid*>pExportTableId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1264
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1255
 * 
 * 
 * cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetExportTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1267
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer(struct cudaMemcpy3DPeerParms const *__pyx_v_p) {
  cudaError_t __pyx_v_err;
  struct cudaMemcpy3DParms __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  cudaArray_t __pyx_t_3;
  struct cudaPos __pyx_t_4;
  struct cudaPitchedPtr __pyx_t_5;
  struct cudaExtent __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy3DPeer", __pyx_f[0], 1267, 1, __PYX_ERR(0, 1267, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1268
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_p == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1269
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1269, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1270
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1268
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1272
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1274
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1275
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1275, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1276
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1277
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1276
 *     memset(&cp, 0, sizeof(cp))
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1278
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1279
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_4 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1280
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr             # <<<<<<<<<<<<<<
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 */
  __pyx_t_5 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1281
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray             # <<<<<<<<<<<<<<
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1282
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos             # <<<<<<<<<<<<<<
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 */
  __pyx_t_4 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1283
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr             # <<<<<<<<<<<<<<
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 */
  __pyx_t_5 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1284
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent             # <<<<<<<<<<<<<<
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 */
  __pyx_t_6 = (__pyx_v_p[0]).extent;
  __pyx_v_cp.extent = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1285
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice             # <<<<<<<<<<<<<<
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 */
  __pyx_v_cp.kind = cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1287
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D((&__pyx_v_cp), 1, (__pyx_v_p[0]).srcDevice, (__pyx_v_p[0]).dstDevice, NULL, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1287, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1288
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1289
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1289, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1288
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1290
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1267
 * 
 * 
 * cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3DPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1292
 *     return err
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync(struct cudaMemcpy3DPeerParms const *__pyx_v_p, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  struct cudaMemcpy3DParms __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  cudaArray_t __pyx_t_3;
  struct cudaPos __pyx_t_4;
  struct cudaPitchedPtr __pyx_t_5;
  struct cudaExtent __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpy3DPeerAsync", __pyx_f[0], 1292, 1, __PYX_ERR(0, 1292, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1293
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_p == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1294
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1294, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1295
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1293
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1297
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1299
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaMemcpy3DParms cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1301
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1301, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1302
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1303
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1302
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cp.srcArray = p[0].srcArray
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1304
 *     if err != cudaSuccess:
 *         return err
 *     cp.srcArray = p[0].srcArray             # <<<<<<<<<<<<<<
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).srcArray;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1305
 *         return err
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos             # <<<<<<<<<<<<<<
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 */
  __pyx_t_4 = (__pyx_v_p[0]).srcPos;
  __pyx_v_cp.srcPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1306
 *     cp.srcArray = p[0].srcArray
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr             # <<<<<<<<<<<<<<
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 */
  __pyx_t_5 = (__pyx_v_p[0]).srcPtr;
  __pyx_v_cp.srcPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1307
 *     cp.srcPos = p[0].srcPos
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray             # <<<<<<<<<<<<<<
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 */
  __pyx_t_3 = (__pyx_v_p[0]).dstArray;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1308
 *     cp.srcPtr = p[0].srcPtr
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos             # <<<<<<<<<<<<<<
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 */
  __pyx_t_4 = (__pyx_v_p[0]).dstPos;
  __pyx_v_cp.dstPos = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1309
 *     cp.dstArray = p[0].dstArray
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr             # <<<<<<<<<<<<<<
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 */
  __pyx_t_5 = (__pyx_v_p[0]).dstPtr;
  __pyx_v_cp.dstPtr = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1310
 *     cp.dstPos = p[0].dstPos
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent             # <<<<<<<<<<<<<<
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 */
  __pyx_t_6 = (__pyx_v_p[0]).extent;
  __pyx_v_cp.extent = __pyx_t_6;

  /* "cuda/_lib/ccudart/ccudart.pyx":1311
 *     cp.dstPtr = p[0].dstPtr
 *     cp.extent = p[0].extent
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice             # <<<<<<<<<<<<<<
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 */
  __pyx_v_cp.kind = cudaMemcpyDeviceToDevice;

  /* "cuda/_lib/ccudart/ccudart.pyx":1313
 *     cp.kind = cudaMemcpyKind.cudaMemcpyDeviceToDevice
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D((&__pyx_v_cp), 1, (__pyx_v_p[0]).srcDevice, (__pyx_v_p[0]).dstDevice, __pyx_v_stream, 1); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1313, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1314
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1315
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1315, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1314
 * 
 *     err = memcpy3D(&cp, True, p[0].srcDevice, p[0].dstDevice, stream, True)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1316
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1292
 *     return err
 * 
 * cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if p == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpy3DPeerAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1319
 * 
 * 
 * cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPitchedPtr s
 *     s.ptr   = d
 */

static struct cudaPitchedPtr __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPitchedPtr(void *__pyx_v_d, size_t __pyx_v_p, size_t __pyx_v_xsz, size_t __pyx_v_ysz) {
  struct cudaPitchedPtr __pyx_v_s;
  struct cudaPitchedPtr __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_make_cudaPitchedPtr", __pyx_f[0], 1319, 1, __PYX_ERR(0, 1319, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1321
 * 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":1322
 *     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":1323
 *     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":1324
 *     s.pitch = p
 *     s.xsize = xsz
 *     s.ysize = ysz             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
  __pyx_v_s.ysize = __pyx_v_ysz;

  /* "cuda/_lib/ccudart/ccudart.pyx":1325
 *     s.xsize = xsz
 *     s.ysize = ysz
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1319
 * 
 * 
 * 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:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._make_cudaPitchedPtr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1328
 * 
 * 
 * cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaPos p
 *     p.x = x
 */

static struct cudaPos __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPos(size_t __pyx_v_x, size_t __pyx_v_y, size_t __pyx_v_z) {
  struct cudaPos __pyx_v_p;
  struct cudaPos __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_make_cudaPos", __pyx_f[0], 1328, 1, __PYX_ERR(0, 1328, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1330
 * 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":1331
 *     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":1332
 *     p.x = x
 *     p.y = y
 *     p.z = z             # <<<<<<<<<<<<<<
 *     return p
 * 
 */
  __pyx_v_p.z = __pyx_v_z;

  /* "cuda/_lib/ccudart/ccudart.pyx":1333
 *     p.y = y
 *     p.z = z
 *     return p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1328
 * 
 * 
 * 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:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._make_cudaPos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1336
 * 
 * 
 * cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent e
 *     e.width  = w
 */

static struct cudaExtent __pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaExtent(size_t __pyx_v_w, size_t __pyx_v_h, size_t __pyx_v_d) {
  struct cudaExtent __pyx_v_e;
  struct cudaExtent __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_make_cudaExtent", __pyx_f[0], 1336, 1, __PYX_ERR(0, 1336, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1338
 * 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":1339
 *     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":1340
 *     e.width  = w
 *     e.height = h
 *     e.depth  = d             # <<<<<<<<<<<<<<
 *     return e
 * 
 */
  __pyx_v_e.depth = __pyx_v_d;

  /* "cuda/_lib/ccudart/ccudart.pyx":1341
 *     e.height = h
 *     e.depth  = d
 *     return e             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_e;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1336
 * 
 * 
 * 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:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._make_cudaExtent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1344
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     flags &= ~cudaDeviceMapHost
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDeviceFlags(unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_scheduleFlags;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaSetDeviceFlags", __pyx_f[0], 1344, 1, __PYX_ERR(0, 1344, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1345
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1346
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     flags &= ~cudaDeviceMapHost             # <<<<<<<<<<<<<<
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_flags = (__pyx_v_flags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMapHost));

  /* "cuda/_lib/ccudart/ccudart.pyx":1347
 *     cdef cudaError_t err = cudaSuccess
 *     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":1348
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1348, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1349
 *     if flags & ~cudaDeviceMask:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1347
 *     cdef cudaError_t err = cudaSuccess
 *     flags &= ~cudaDeviceMapHost
 *     if flags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1350
 *         _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":1351
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  __pyx_t_3 = (__pyx_v_scheduleFlags != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1353
 *     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":1351
 *         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":1352
 *     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":1351
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
    __pyx_t_3 = 0;
    break;
    default:
    __pyx_t_3 = 1;
    break;
  }
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1354
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1354, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1355
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1351
 *         return cudaErrorInvalidValue
 *     cdef unsigned int scheduleFlags = flags & cudaDeviceScheduleMask
 *     if scheduleFlags and (scheduleFlags != cudaDeviceScheduleSpin and             # <<<<<<<<<<<<<<
 *                           scheduleFlags != cudaDeviceScheduleYield and
 *                           scheduleFlags != cudaDeviceScheduleBlockingSync):
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1356
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1356, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1357
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1358
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUcontext context
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1357
 *         return cudaErrorInvalidValue
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1361
 * 
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1361, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1362
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1363
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1363, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1364
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* device
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1362
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1367
 * 
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1367, __pyx_L1_error)
  __pyx_v_device = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1368
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_1 = (__pyx_v_device == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1371
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1368
 *     cdef cudaPythonDevice* device
 *     device = m_global.getDeviceFromPrimaryCtx(context)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1373
 *         return cudaErrorIncompatibleDriverContext
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2((__pyx_v_device[0]).driverDevice, __pyx_v_flags); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1373, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":1374
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1375
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1375, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1374
 * 
 *     err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1376
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1344
 * 
 * 
 * cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     flags &= ~cudaDeviceMapHost
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaSetDeviceFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1379
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if nodeParams == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemAllocNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaMemAllocNodeParams *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddMemAllocNode", __pyx_f[0], 1379, 1, __PYX_ERR(0, 1379, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1380
 * 
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1381
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_nodeParams == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1382
 *     cdef cudaError_t err = cudaSuccess
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1382, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1383
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1381
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1385
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1385, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1386
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1387
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1386
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1388
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, ((CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1388, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1389
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1390
 *     err = <cudaError_t>ccuda._cuGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1390, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1389
 *         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":1391
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1379
 * 
 * 
 * cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if nodeParams == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemAllocNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1394
 * 
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if params_out == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemAllocNodeParams *__pyx_v_params_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphMemAllocNodeGetParams", __pyx_f[0], 1394, 1, __PYX_ERR(0, 1394, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1395
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1396
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if params_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_params_out == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1397
 *     cdef cudaError_t err = cudaSuccess
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1397, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1398
 *     if params_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1396
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if params_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1400
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1400, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1401
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1402
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1401
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1403
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams(__pyx_v_node, ((CUDA_MEM_ALLOC_NODE_PARAMS *)__pyx_v_params_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1403, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1404
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1405
 *     err = <cudaError_t>ccuda._cuGraphMemAllocNodeGetParams(node, <ccuda.CUDA_MEM_ALLOC_NODE_PARAMS *>params_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1405, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1404
 *         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":1406
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1394
 * 
 * 
 * cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if params_out == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemAllocNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1409
 * 
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if dptr_out == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams(cudaGraphNode_t __pyx_v_node, void *__pyx_v_dptr_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphMemFreeNodeGetParams", __pyx_f[0], 1409, 1, __PYX_ERR(0, 1409, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1410
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1411
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if dptr_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_dptr_out == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1412
 *     cdef cudaError_t err = cudaSuccess
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1412, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1413
 *     if dptr_out == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1411
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if dptr_out == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1415
 *         return cudaErrorInvalidValue
 * 
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1415, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1416
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1417
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1416
 * 
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1418
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams(__pyx_v_node, ((CUdeviceptr *)__pyx_v_dptr_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1418, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1419
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1420
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1420, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1419
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemFreeNodeGetParams(node, <ccuda.CUdeviceptr *>dptr_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1421
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1409
 * 
 * 
 * cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     if dptr_out == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemFreeNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1424
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise(void const *__pyx_v_devPtr, size_t __pyx_v_count, enum cudaMemoryAdvise __pyx_v_advice, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemAdvise", __pyx_f[0], 1424, 1, __PYX_ERR(0, 1424, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1425
 * 
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1426
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, ((CUmem_advise)__pyx_v_advice), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1426, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1427
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1428
 *     err = <cudaError_t>ccuda._cuMemAdvise(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1428, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1427
 *     cdef cudaError_t err = cudaSuccess
 *     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":1429
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1424
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     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
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemAdvise", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1432
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise_v2(void const *__pyx_v_devPtr, size_t __pyx_v_count, enum cudaMemoryAdvise __pyx_v_advice, struct cudaMemLocation __pyx_v_location) {
  cudaError_t __pyx_v_err;
  CUmemLocation __pyx_v__driver_location;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  int __pyx_t_3;
  cudaError_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemAdvise_v2", __pyx_f[0], 1432, 1, __PYX_ERR(0, 1432, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1433
 * 
 * cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUmemLocation _driver_location
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1435
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type             # <<<<<<<<<<<<<<
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)
 */
  __pyx_v__driver_location.type = ((CUmemLocationType)__pyx_v_location.type);

  /* "cuda/_lib/ccudart/ccudart.pyx":1436
 *     cdef ccuda.CUmemLocation _driver_location
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 *     _driver_location.id = location.id             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)
 *     if err != cudaSuccess:
 */
  __pyx_t_1 = __pyx_v_location.id;
  __pyx_v__driver_location.id = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1437
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise_v2(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, ((CUmem_advise)__pyx_v_advice), __pyx_v__driver_location); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1437, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/ccudart.pyx":1438
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_3 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1439
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_4 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1439, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1438
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemAdvise_v2(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUmem_advise>advice, _driver_location)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1440
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1432
 * 
 * 
 * cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemAdvise_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1443
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute(void *__pyx_v_data, size_t __pyx_v_dataSize, enum cudaMemRangeAttribute __pyx_v_attribute, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemRangeGetAttribute", __pyx_f[0], 1443, 1, __PYX_ERR(0, 1443, __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1445
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute(__pyx_v_data, __pyx_v_dataSize, ((CUmem_range_attribute)__pyx_v_attribute), ((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1445, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1446
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1447
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttribute(data, dataSize, <ccuda.CUmem_range_attribute>attribute, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1447, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1446
 *     cdef cudaError_t err = cudaSuccess
 *     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":1448
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1443
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     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
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemRangeGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1451
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttributes(void **__pyx_v_data, size_t *__pyx_v_dataSizes, enum cudaMemRangeAttribute *__pyx_v_attributes, size_t __pyx_v_numAttributes, void const *__pyx_v_devPtr, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemRangeGetAttributes", __pyx_f[0], 1451, 1, __PYX_ERR(0, 1451, __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) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1453
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes(__pyx_v_data, __pyx_v_dataSizes, ((CUmem_range_attribute *)__pyx_v_attributes), __pyx_v_numAttributes, ((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1453, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1454
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1455
 *     err = <cudaError_t>ccuda._cuMemRangeGetAttributes(data, dataSizes, <ccuda.CUmem_range_attribute*>attributes, numAttributes, <ccuda.CUdeviceptr>devPtr, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1455, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1454
 *     cdef cudaError_t err = cudaSuccess
 *     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":1456
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1451
 * 
 * 
 * cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     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
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemRangeGetAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1459
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceCount(int *__pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetDeviceCount", __pyx_f[0], 1459, 1, __PYX_ERR(0, 1459, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1460
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1461
 * cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1461, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1462
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     count[0] = m_global._numDevices
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1463
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     count[0] = m_global._numDevices
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1462
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     count[0] = m_global._numDevices
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1464
 *     if err != cudaSuccess:
 *         return err
 *     count[0] = m_global._numDevices             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_3 = __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->_numDevices;
  (__pyx_v_count[0]) = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1465
 *         return err
 *     count[0] = m_global._numDevices
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1459
 * 
 * 
 * cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetDeviceCount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1468
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetAttribute(int *__pyx_v_value, enum cudaDeviceAttr __pyx_v_attr, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetAttribute", __pyx_f[0], 1468, 1, __PYX_ERR(0, 1468, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1469
 * 
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1470
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute(__pyx_v_value, ((CUdevice_attribute)__pyx_v_attr), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1470, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1471
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1472
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1472, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1471
 *     cdef cudaError_t err = cudaSuccess
 *     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":1473
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1468
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetAttribute(value, <ccuda.CUdevice_attribute>attr, <ccuda.CUdevice>device)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1476
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig __pyx_v_config) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSetSharedMemConfig", __pyx_f[0], 1476, 1, __PYX_ERR(0, 1476, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1477
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1478
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1479
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1480
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1479
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1481
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig(((CUsharedconfig)__pyx_v_config)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1481, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1482
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1483
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1483, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1482
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetSharedMemConfig(<ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1484
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1476
 * 
 * 
 * cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetSharedMemConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1487
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId(int *__pyx_v_device, char const *__pyx_v_pciBusId) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetByPCIBusId", __pyx_f[0], 1487, 1, __PYX_ERR(0, 1487, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1488
 * 
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1489
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId(((CUdevice *)__pyx_v_device), __pyx_v_pciBusId); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1489, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1490
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1491
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1491, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1490
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1492
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1487
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetByPCIBusId(<ccuda.CUdevice*>device, pciBusId)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetByPCIBusId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1495
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetPCIBusId(char *__pyx_v_pciBusId, int __pyx_v_length, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetPCIBusId", __pyx_f[0], 1495, 1, __PYX_ERR(0, 1495, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1496
 * 
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1497
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId(__pyx_v_pciBusId, __pyx_v_length, ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1497, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1498
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1499
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1499, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1498
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1500
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1495
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetPCIBusId(pciBusId, length, <ccuda.CUdevice>device)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetPCIBusId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1503
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetP2PAttribute(int *__pyx_v_value, enum cudaDeviceP2PAttr __pyx_v_attr, int __pyx_v_srcDevice, int __pyx_v_dstDevice) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetP2PAttribute", __pyx_f[0], 1503, 1, __PYX_ERR(0, 1503, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1504
 * 
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1505
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute(__pyx_v_value, ((CUdevice_P2PAttribute)__pyx_v_attr), ((CUdevice)__pyx_v_srcDevice), ((CUdevice)__pyx_v_dstDevice)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1505, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/ccudart.pyx":1506
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1507
 *     err = <cudaError_t>ccuda._cuDeviceGetP2PAttribute(value, <ccuda.CUdevice_P2PAttribute>attr, <ccuda.CUdevice>srcDevice, <ccuda.CUdevice>dstDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1507, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1506
 *     cdef cudaError_t err = cudaSuccess
 *     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":1508
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1503
 * 
 * 
 * cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     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
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetP2PAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1511
 * 
 * 
 * cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetSparseProperties(struct cudaArraySparseProperties *__pyx_v_sparseProperties, cudaArray_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaArrayGetSparseProperties", __pyx_f[0], 1511, 1, __PYX_ERR(0, 1511, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1512
 * 
 * cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1514
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  __pyx_t_1 = (!(__pyx_v_sparseProperties != 0));
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1515
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1515, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1516
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1514
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1517
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 */
  (void)(memset(__pyx_v_sparseProperties, 0, (sizeof(struct cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1519
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1519, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1520
 * 
 *     err = <cudaError_t>ccuda._cuArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUarray>array)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  __pyx_t_1 = (__pyx_v_err == cudaSuccess);
  if (__pyx_t_1) {

    /* "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
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1522
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize             # <<<<<<<<<<<<<<
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 */
    __pyx_t_5 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1523
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1524
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1525
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1526
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1520
 * 
 *     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":1528
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1529
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1529, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1528
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1530
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1511
 * 
 * 
 * cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetSparseProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1533
 * 
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *__pyx_v_sparseProperties, cudaMipmappedArray_t __pyx_v_mipmap) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_SPARSE_PROPERTIES __pyx_v__driver_sparseProperties;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMipmappedArrayGetSparseProperties", __pyx_f[0], 1533, 1, __PYX_ERR(0, 1533, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1534
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1536
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  __pyx_t_1 = (!(__pyx_v_sparseProperties != 0));
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1537
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1537, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1538
 *     if not sparseProperties:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1536
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 *     if not sparseProperties:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1539
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaError.cudaErrorInvalidValue
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 */
  (void)(memset(__pyx_v_sparseProperties, 0, (sizeof(struct cudaArraySparseProperties))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1541
 *     memset(sparseProperties, 0, sizeof(cudaArraySparseProperties))
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties((&__pyx_v__driver_sparseProperties), ((CUmipmappedArray)__pyx_v_mipmap)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1541, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1542
 * 
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetSparseProperties(&_driver_sparseProperties, <ccuda.CUmipmappedArray>mipmap)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 */
  __pyx_t_1 = (__pyx_v_err == cudaSuccess);
  if (__pyx_t_1) {

    /* "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
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.miptailFirstLevel;
    (__pyx_v_sparseProperties[0]).miptailFirstLevel = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1544
 *     if err == cudaSuccess:
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize             # <<<<<<<<<<<<<<
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 */
    __pyx_t_5 = __pyx_v__driver_sparseProperties.miptailSize;
    (__pyx_v_sparseProperties[0]).miptailSize = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1545
 *         sparseProperties[0].miptailFirstLevel = _driver_sparseProperties.miptailFirstLevel
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.flags;
    (__pyx_v_sparseProperties[0]).flags = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1546
 *         sparseProperties[0].miptailSize       = _driver_sparseProperties.miptailSize
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.width;
    (__pyx_v_sparseProperties[0]).tileExtent.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1547
 *         sparseProperties[0].flags             = _driver_sparseProperties.flags
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height             # <<<<<<<<<<<<<<
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.height;
    (__pyx_v_sparseProperties[0]).tileExtent.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1548
 *         sparseProperties[0].tileExtent.width  = _driver_sparseProperties.tileExtent.width
 *         sparseProperties[0].tileExtent.height = _driver_sparseProperties.tileExtent.height
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_t_4 = __pyx_v__driver_sparseProperties.tileExtent.depth;
    (__pyx_v_sparseProperties[0]).tileExtent.depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1542
 * 
 *     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":1550
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1551
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1551, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1550
 *         sparseProperties[0].tileExtent.depth  = _driver_sparseProperties.tileExtent.depth
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1552
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1533
 * 
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_SPARSE_PROPERTIES _driver_sparseProperties
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMipmappedArrayGetSparseProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1555
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer(int *__pyx_v_canAccessPeer, int __pyx_v_device, int __pyx_v_peerDevice) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_driverDevice;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_driverPeerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  int __pyx_t_4;
  CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceCanAccessPeer", __pyx_f[0], 1555, 1, __PYX_ERR(0, 1555, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1556
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1557
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1557, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1558
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef cudaPythonDevice *driverDevice
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1559
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *driverDevice
 *     cdef cudaPythonDevice *driverPeerDevice
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1558
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef cudaPythonDevice *driverDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1562
 *     cdef cudaPythonDevice *driverDevice
 *     cdef cudaPythonDevice *driverPeerDevice
 *     driverDevice = m_global.getDevice(device)             # <<<<<<<<<<<<<<
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_device); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1562, __pyx_L1_error)
  __pyx_v_driverDevice = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1563
 *     cdef cudaPythonDevice *driverPeerDevice
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1563, __pyx_L1_error)
  __pyx_v_driverPeerDevice = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1564
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
  __pyx_t_4 = (__pyx_v_driverDevice == NULL);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_driverPeerDevice == NULL);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1565
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1564
 *     driverDevice = m_global.getDevice(device)
 *     driverPeerDevice = m_global.getDevice(peerDevice)
 *     if driverDevice == NULL or driverPeerDevice == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1567
 *         return cudaErrorInvalidDevice
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer(__pyx_v_canAccessPeer, __pyx_v_driverDevice->driverDevice, __pyx_v_driverPeerDevice->driverDevice); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1567, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":1568
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1569
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     if device == peerDevice:
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1569, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1570
 *     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":1568
 * 
 *     err = <cudaError_t>ccuda._cuDeviceCanAccessPeer(canAccessPeer, driverDevice.driverDevice, driverPeerDevice.driverDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1571
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  __pyx_t_2 = (__pyx_v_device == __pyx_v_peerDevice);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1572
 *         return err
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (__pyx_v_canAccessPeer[0]) = 0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1571
 *         _setLastError(err)
 *         return err
 *     if device == peerDevice:             # <<<<<<<<<<<<<<
 *         canAccessPeer[0] = 0
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1573
 *     if device == peerDevice:
 *         canAccessPeer[0] = 0
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1555
 * 
 * 
 * cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitDriver()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceCanAccessPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1576
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeer(void *__pyx_v_dst, int __pyx_v_dstDevice, void const *__pyx_v_src, int __pyx_v_srcDevice, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_peerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  int __pyx_t_4;
  CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyPeer", __pyx_f[0], 1576, 1, __PYX_ERR(0, 1576, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1577
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1580
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1580, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1581
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1582
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1581
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1583
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  __pyx_t_2 = (__pyx_v_count > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1584
 *         return err
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)             # <<<<<<<<<<<<<<
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_dstDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1584, __pyx_L1_error)
    __pyx_v_peerDevice = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1585
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)             # <<<<<<<<<<<<<<
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_srcDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1585, __pyx_L1_error)
    __pyx_v_device = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1586
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    __pyx_t_4 = (__pyx_v_device == NULL);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_peerDevice == NULL);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1587
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1587, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1588
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidDevice;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1586
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1589
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_peerDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1589, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1590
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1591
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = initPrimaryContext(device)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1591, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1592
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1590
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1593
 *             _setLastError(err)
 *             return err
 *         err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1593, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1594
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1595
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1595, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1596
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1594
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1597
 *             _setLastError(err)
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer(((CUdeviceptr)__pyx_v_dst), (__pyx_v_peerDevice[0]).primaryContext, ((CUdeviceptr)__pyx_v_src), (__pyx_v_device[0]).primaryContext, __pyx_v_count); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1597, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_5);

    /* "cuda/_lib/ccudart/ccudart.pyx":1598
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1599
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *     return err
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1599, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1600
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1598
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeer(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1583
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1601
 *             _setLastError(err)
 *             return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1576
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyPeer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1604
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeerAsync(void *__pyx_v_dst, int __pyx_v_dstDevice, void const *__pyx_v_src, int __pyx_v_srcDevice, size_t __pyx_v_count, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_peerDevice;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  int __pyx_t_4;
  CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemcpyPeerAsync", __pyx_f[0], 1604, 1, __PYX_ERR(0, 1604, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1605
 * 
 * cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1608
 *     cdef cudaPythonDevice *device
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1608, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1609
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1610
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1609
 *     cdef cudaPythonDevice *peerDevice
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if count > 0:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1611
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  __pyx_t_2 = (__pyx_v_count > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1612
 *         return err
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)             # <<<<<<<<<<<<<<
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_dstDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1612, __pyx_L1_error)
    __pyx_v_peerDevice = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1613
 *     if count > 0:
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)             # <<<<<<<<<<<<<<
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_srcDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1613, __pyx_L1_error)
    __pyx_v_device = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1614
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    __pyx_t_4 = (__pyx_v_device == NULL);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_peerDevice == NULL);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1615
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1615, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1616
 *         if device == NULL or peerDevice == NULL:
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidDevice;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1614
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 *         if device == NULL or peerDevice == NULL:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1617
 *             _setLastError(err)
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_peerDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1617, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1618
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1619
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = initPrimaryContext(device)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1619, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1620
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1618
 *             return cudaErrorInvalidDevice
 *         err = initPrimaryContext(peerDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1621
 *             _setLastError(err)
 *             return err
 *         err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1621, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/ccudart.pyx":1622
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1623
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1623, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1624
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1622
 *             return err
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1625
 *             _setLastError(err)
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync(((CUdeviceptr)__pyx_v_dst), (__pyx_v_peerDevice[0]).primaryContext, ((CUdeviceptr)__pyx_v_src), (__pyx_v_device[0]).primaryContext, __pyx_v_count, ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1625, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_5);

    /* "cuda/_lib/ccudart/ccudart.pyx":1626
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1627
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *     return err
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1627, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1628
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1626
 *             return err
 *         err = <cudaError_t>ccuda._cuMemcpyPeerAsync(<ccuda.CUdeviceptr>dst, peerDevice[0].primaryContext, <ccuda.CUdeviceptr>src, device[0].primaryContext, count, <ccuda.CUstream>stream)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1611
 *     if err != cudaSuccess:
 *         return err
 *     if count > 0:             # <<<<<<<<<<<<<<
 *         peerDevice = m_global.getDevice(dstDevice)
 *         device = m_global.getDevice(srcDevice)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1629
 *             _setLastError(err)
 *             return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1604
 * 
 * 
 * cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemcpyPeerAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1632
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess(int __pyx_v_peerDevice, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_dev;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceEnablePeerAccess", __pyx_f[0], 1632, 1, __PYX_ERR(0, 1632, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1633
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1636
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1636, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1637
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1638
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1638, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1639
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1637
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1640
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1640, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1641
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1642
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1642, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1643
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1641
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1644
 *         _setLastError(err)
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1644, __pyx_L1_error)
  __pyx_v_dev = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1645
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_2 = (__pyx_v_dev == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1648
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)             # <<<<<<<<<<<<<<
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorIncompatibleDriverContext); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1648, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1649
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1645
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1650
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1650, __pyx_L1_error)
  __pyx_v_dev = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1651
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  __pyx_t_2 = (__pyx_v_dev == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1652
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1651
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1653
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_dev); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1653, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1654
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1655
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1655, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1656
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1654
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1657
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess(__pyx_v_dev->primaryContext, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1657, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1658
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1659
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1659, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1658
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxEnablePeerAccess(dev.primaryContext, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1660
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1632
 * 
 * 
 * cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUcontext context
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceEnablePeerAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1663
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceDisablePeerAccess(int __pyx_v_peerDevice) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_dev;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceDisablePeerAccess", __pyx_f[0], 1663, 1, __PYX_ERR(0, 1663, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1664
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1667
 *     cdef ccuda.CUcontext context
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1667, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1668
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1669
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1669, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1670
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1668
 *     cdef cudaPythonDevice *dev
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1671
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent((&__pyx_v_context)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1671, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1672
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1673
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1673, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1674
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1672
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1675
 *         _setLastError(err)
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         # We don't know if context provided is primary or not
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_context); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1675, __pyx_L1_error)
  __pyx_v_dev = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1676
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  __pyx_t_2 = (__pyx_v_dev == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1679
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)             # <<<<<<<<<<<<<<
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorIncompatibleDriverContext); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1679, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1680
 *         # cudaSetDevice may need to be called before retrying call
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 */
    __pyx_r = cudaErrorIncompatibleDriverContext;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1676
 *         return err
 *     dev = m_global.getDeviceFromPrimaryCtx(context)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         # We don't know if context provided is primary or not
 *         # cudaSetDevice may need to be called before retrying call
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1681
 *         _setLastError(cudaErrorIncompatibleDriverContext)
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)             # <<<<<<<<<<<<<<
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_peerDevice); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1681, __pyx_L1_error)
  __pyx_v_dev = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1682
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  __pyx_t_2 = (__pyx_v_dev == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1683
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1682
 *         return cudaErrorIncompatibleDriverContext
 *     dev = m_global.getDevice(peerDevice)
 *     if dev == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1684
 *     if dev == NULL:
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_dev); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1684, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1685
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1686
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1686, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1687
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1685
 *         return cudaErrorInvalidDevice
 *     err = initPrimaryContext(dev)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1688
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess(__pyx_v_dev->primaryContext); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1688, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1689
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1690
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1690, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1689
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxDisablePeerAccess(dev.primaryContext)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1691
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1663
 * 
 * 
 * cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUcontext context
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceDisablePeerAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1693
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmap, cudaExternalMemory_t __pyx_v_extMem, struct cudaExternalMemoryMipmappedArrayDesc const *__pyx_v_mipmapDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC __pyx_v__driver_mipmapDesc;
  cudaError_t __pyx_v_err_rt;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  unsigned PY_LONG_LONG __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  CUresult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedMipmappedArray", __pyx_f[0], 1693, 1, __PYX_ERR(0, 1693, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1694
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1695
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1695, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1697
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 */
  (void)(memset((&__pyx_v__driver_mipmapDesc), 0, (sizeof(__pyx_v__driver_mipmapDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1698
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC _driver_mipmapDesc
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 */
  __pyx_t_2 = (__pyx_v_mipmapDesc[0]).offset;
  __pyx_v__driver_mipmapDesc.offset = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1699
 *     memset(&_driver_mipmapDesc, 0, sizeof(_driver_mipmapDesc))
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.width;
  __pyx_v__driver_mipmapDesc.arrayDesc.Width = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1700
 *     _driver_mipmapDesc.offset = mipmapDesc[0].offset
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.height;
  __pyx_v__driver_mipmapDesc.arrayDesc.Height = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1701
 *     _driver_mipmapDesc.arrayDesc.Width = mipmapDesc[0].extent.width
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth             # <<<<<<<<<<<<<<
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:
 */
  __pyx_t_3 = (__pyx_v_mipmapDesc[0]).extent.depth;
  __pyx_v__driver_mipmapDesc.arrayDesc.Depth = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1702
 *     _driver_mipmapDesc.arrayDesc.Height = mipmapDesc[0].extent.height
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)             # <<<<<<<<<<<<<<
 *     if err_rt != cudaError.cudaSuccess:
 *         _setLastError(err_rt)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_mipmapDesc[0]).formatDesc), ((int *)(&__pyx_v__driver_mipmapDesc.arrayDesc.NumChannels)), (&__pyx_v__driver_mipmapDesc.arrayDesc.Format)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1702, __pyx_L1_error)
  __pyx_v_err_rt = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1703
 *     _driver_mipmapDesc.arrayDesc.Depth = mipmapDesc[0].extent.depth
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err_rt)
 *         return err_rt
 */
  __pyx_t_4 = (__pyx_v_err_rt != cudaSuccess);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1704
 *     err_rt = getDescInfo(&mipmapDesc[0].formatDesc, <int *>&_driver_mipmapDesc.arrayDesc.NumChannels, &_driver_mipmapDesc.arrayDesc.Format)
 *     if err_rt != cudaError.cudaSuccess:
 *         _setLastError(err_rt)             # <<<<<<<<<<<<<<
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err_rt); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1704, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1705
 *     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":1703
 *     _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":1706
 *         _setLastError(err_rt)
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags             # <<<<<<<<<<<<<<
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 */
  __pyx_t_5 = (__pyx_v_mipmapDesc[0]).flags;
  __pyx_v__driver_mipmapDesc.arrayDesc.Flags = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1707
 *         return err_rt
 *     _driver_mipmapDesc.arrayDesc.Flags = mipmapDesc[0].flags
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_5 = (__pyx_v_mipmapDesc[0]).numLevels;
  __pyx_v__driver_mipmapDesc.numLevels = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1709
 *     _driver_mipmapDesc.numLevels = mipmapDesc[0].numLevels
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 */
  __pyx_t_4 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1710
 * 
 *     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":1709
 *     _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":1711
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_6 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray(((CUmipmappedArray *)__pyx_v_mipmap), ((CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_mipmapDesc)); if (unlikely(__pyx_t_6 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1711, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_6);

  /* "cuda/_lib/ccudart/ccudart.pyx":1712
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_4 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1713
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmap, <ccuda.CUexternalMemory>extMem, &_driver_mipmapDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1713, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1712
 *         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":1714
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1693
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaExternalMemoryGetMappedMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1716
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *__pyx_v_pResDesc, cudaSurfaceObject_t __pyx_v_surfObject) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  long __pyx_v_channel_size;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetSurfaceObjectResourceDesc", __pyx_f[0], 1716, 1, __PYX_ERR(0, 1716, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1717
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1718
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1718, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1721
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1722
 * 
 *     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":1721
 *     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":1723
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)             # <<<<<<<<<<<<<<
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc((&__pyx_v__driver_pResDesc), ((CUsurfObject)__pyx_v_surfObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1723, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1724
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))             # <<<<<<<<<<<<<<
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 */
  (void)(memset(__pyx_v_pResDesc, 0, (sizeof(struct cudaResourceDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1725
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 */
  switch (__pyx_v__driver_pResDesc.resType) {
    case CU_RESOURCE_TYPE_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1726
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1727
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 */
    (__pyx_v_pResDesc[0]).res.array.array = ((cudaArray_t)__pyx_v__driver_pResDesc.res.array.hArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1725
 *     err = <cudaError_t>ccuda._cuSurfObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUsurfObject>surfObject)
 *     memset(pResDesc, 0, sizeof(cudaResourceDesc))
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 */
    break;
    case CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:

    /* "cuda/_lib/ccudart/ccudart.pyx":1729
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeMipmappedArray;

    /* "cuda/_lib/ccudart/ccudart.pyx":1730
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 */
    (__pyx_v_pResDesc[0]).res.mipmap.mipmap = ((cudaMipmappedArray_t)__pyx_v__driver_pResDesc.res.mipmap.hMipmappedArray);

    /* "cuda/_lib/ccudart/ccudart.pyx":1728
 *         pResDesc[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         pResDesc[0].res.array.array = <cudaArray_t>_driver_pResDesc.res.array.hArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 */
    break;
    case CU_RESOURCE_TYPE_LINEAR:

    /* "cuda/_lib/ccudart/ccudart.pyx":1732
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypeLinear;

    /* "cuda/_lib/ccudart/ccudart.pyx":1733
 *     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":1734
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes             # <<<<<<<<<<<<<<
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.linear.sizeInBytes;
    (__pyx_v_pResDesc[0]).res.linear.sizeInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1731
 *         pResDesc[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         pResDesc[0].res.mipmap.mipmap = <cudaMipmappedArray_t>_driver_pResDesc.res.mipmap.hMipmappedArray
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR:             # <<<<<<<<<<<<<<
 *         pResDesc[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         pResDesc[0].res.linear.devPtr      = <void *>_driver_pResDesc.res.linear.devPtr
 */
    break;
    case CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1736
 *         pResDesc[0].res.linear.sizeInBytes = _driver_pResDesc.res.linear.sizeInBytes
 *     elif _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 */
    (__pyx_v_pResDesc[0]).resType = cudaResourceTypePitch2D;

    /* "cuda/_lib/ccudart/ccudart.pyx":1737
 *     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":1738
 *         pResDesc[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.pitchInBytes;
    (__pyx_v_pResDesc[0]).res.pitch2D.pitchInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1739
 *         pResDesc[0].res.pitch2D.devPtr       = <void *>_driver_pResDesc.res.pitch2D.devPtr
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.width;
    (__pyx_v_pResDesc[0]).res.pitch2D.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1740
 *         pResDesc[0].res.pitch2D.pitchInBytes = _driver_pResDesc.res.pitch2D.pitchInBytes
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height             # <<<<<<<<<<<<<<
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 */
    __pyx_t_4 = __pyx_v__driver_pResDesc.res.pitch2D.height;
    (__pyx_v_pResDesc[0]).res.pitch2D.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1735
 *         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":1741
 *         pResDesc[0].res.pitch2D.width        = _driver_pResDesc.res.pitch2D.width
 *         pResDesc[0].res.pitch2D.height       = _driver_pResDesc.res.pitch2D.height
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 */
  switch (__pyx_v__driver_pResDesc.resType) {
    case CU_RESOURCE_TYPE_LINEAR:
    case CU_RESOURCE_TYPE_PITCH2D:

    /* "cuda/_lib/ccudart/ccudart.pyx":1742
 *         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":1743
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 */
    switch (__pyx_v__driver_pResDesc.res.linear.format) {
      case CU_AD_FORMAT_UNSIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1744
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1745
 *         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":1743
 *     if _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_LINEAR or _driver_pResDesc.resType == ccuda.CU_RESOURCE_TYPE_PITCH2D:
 *         channel_size = 0
 *         if _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 */
      break;
      case CU_AD_FORMAT_UNSIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1747
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1748
 *         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":1746
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_UNSIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1750
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindUnsigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1751
 *         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":1749
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT8:

      /* "cuda/_lib/ccudart/ccudart.pyx":1753
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1754
 *         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":1752
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT8:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 8
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT16:

      /* "cuda/_lib/ccudart/ccudart.pyx":1756
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1757
 *         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":1755
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 8
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT16:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT32:

      /* "cuda/_lib/ccudart/ccudart.pyx":1759
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindSigned;

      /* "cuda/_lib/ccudart/ccudart.pyx":1760
 *         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":1758
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_SIGNED_INT32:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_HALF:

      /* "cuda/_lib/ccudart/ccudart.pyx":1762
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1763
 *         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":1761
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_HALF:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 16
 */
      break;
      case CU_AD_FORMAT_FLOAT:

      /* "cuda/_lib/ccudart/ccudart.pyx":1765
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindFloat;

      /* "cuda/_lib/ccudart/ccudart.pyx":1766
 *         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":1764
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 16
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_FLOAT:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *             channel_size = 32
 */
      break;
      case CU_AD_FORMAT_NV12:

      /* "cuda/_lib/ccudart/ccudart.pyx":1768
 *             channel_size = 32
 *         elif _driver_pResDesc.res.linear.format == ccuda.CU_AD_FORMAT_NV12:
 *             pResDesc[0].res.linear.desc.f = cudaChannelFormatKind.cudaChannelFormatKindNV12             # <<<<<<<<<<<<<<
 *             channel_size = 8
 *         else:
 */
      (__pyx_v_pResDesc[0]).res.linear.desc.f = cudaChannelFormatKindNV12;

      /* "cuda/_lib/ccudart/ccudart.pyx":1769
 *         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":1767
 *             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":1771
 *             channel_size = 8
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)             # <<<<<<<<<<<<<<
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 *         pResDesc[0].res.linear.desc.x = 0
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidChannelDescriptor); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1771, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1772
 *         else:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *         pResDesc[0].res.linear.desc.x = 0
 *         pResDesc[0].res.linear.desc.y = 0
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;
      break;
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":1773
 *             _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":1774
 *             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":1775
 *         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":1776
 *         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":1777
 *         pResDesc[0].res.linear.desc.z = 0
 *         pResDesc[0].res.linear.desc.w = 0
 *         if _driver_pResDesc.res.linear.numChannels >= 4:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 */
    __pyx_t_2 = (__pyx_v__driver_pResDesc.res.linear.numChannels >= 4);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1778
 *         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":1777
 *         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":1779
 *         if _driver_pResDesc.res.linear.numChannels >= 4:
 *             pResDesc[0].res.linear.desc.w = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 3:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 */
    __pyx_t_2 = (__pyx_v__driver_pResDesc.res.linear.numChannels >= 3);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1780
 *             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":1779
 *         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":1781
 *         if _driver_pResDesc.res.linear.numChannels >= 3:
 *             pResDesc[0].res.linear.desc.z = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 2:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 */
    __pyx_t_2 = (__pyx_v__driver_pResDesc.res.linear.numChannels >= 2);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1782
 *             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":1781
 *         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":1783
 *         if _driver_pResDesc.res.linear.numChannels >= 2:
 *             pResDesc[0].res.linear.desc.y = channel_size
 *         if _driver_pResDesc.res.linear.numChannels >= 1:             # <<<<<<<<<<<<<<
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 */
    __pyx_t_2 = (__pyx_v__driver_pResDesc.res.linear.numChannels >= 1);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1784
 *             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":1783
 *         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":1785
 *         if _driver_pResDesc.res.linear.numChannels >= 1:
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 */
    __pyx_t_5 = (__pyx_v__driver_pResDesc.res.linear.numChannels < 1);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v__driver_pResDesc.res.linear.numChannels >= 5);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":1786
 *             pResDesc[0].res.linear.desc.x = channel_size
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)             # <<<<<<<<<<<<<<
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidChannelDescriptor); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1786, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":1787
 *         if _driver_pResDesc.res.linear.numChannels < 1 or _driver_pResDesc.res.linear.numChannels >= 5:
 *             _setLastError(cudaErrorInvalidChannelDescriptor)
 *             return cudaError.cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":1785
 *         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":1741
 *         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":1789
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1790
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1790, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1789
 *             return cudaError.cudaErrorInvalidChannelDescriptor
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1791
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1716
 *     return err
 * 
 * cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetSurfaceObjectResourceDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1793
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaKernelNodeParams *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_KERNEL_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  unsigned int __pyx_t_4;
  void **__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphKernelNodeGetParams", __pyx_f[0], 1793, 1, __PYX_ERR(0, 1793, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1794
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1795
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1795, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1798
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1799
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     pNodeParams[0].func = <void*>driverNodeParams.func
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1798
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1800
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     pNodeParams[0].func = <void*>driverNodeParams.func
 *     pNodeParams[0].gridDim.x = driverNodeParams.gridDimX
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams_v2(((CUgraphNode)__pyx_v_node), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1800, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1801
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     pNodeParams[0].func = <void*>driverNodeParams.func             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.x = driverNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = driverNodeParams.gridDimY
 */
  (__pyx_v_pNodeParams[0]).func = ((void *)__pyx_v_driverNodeParams.func);

  /* "cuda/_lib/ccudart/ccudart.pyx":1802
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     pNodeParams[0].func = <void*>driverNodeParams.func
 *     pNodeParams[0].gridDim.x = driverNodeParams.gridDimX             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.y = driverNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = driverNodeParams.gridDimZ
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.gridDimX;
  (__pyx_v_pNodeParams[0]).gridDim.x = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1803
 *     pNodeParams[0].func = <void*>driverNodeParams.func
 *     pNodeParams[0].gridDim.x = driverNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = driverNodeParams.gridDimY             # <<<<<<<<<<<<<<
 *     pNodeParams[0].gridDim.z = driverNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = driverNodeParams.blockDimX
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.gridDimY;
  (__pyx_v_pNodeParams[0]).gridDim.y = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1804
 *     pNodeParams[0].gridDim.x = driverNodeParams.gridDimX
 *     pNodeParams[0].gridDim.y = driverNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = driverNodeParams.gridDimZ             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.x = driverNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = driverNodeParams.blockDimY
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.gridDimZ;
  (__pyx_v_pNodeParams[0]).gridDim.z = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1805
 *     pNodeParams[0].gridDim.y = driverNodeParams.gridDimY
 *     pNodeParams[0].gridDim.z = driverNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = driverNodeParams.blockDimX             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.y = driverNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = driverNodeParams.blockDimZ
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.blockDimX;
  (__pyx_v_pNodeParams[0]).blockDim.x = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1806
 *     pNodeParams[0].gridDim.z = driverNodeParams.gridDimZ
 *     pNodeParams[0].blockDim.x = driverNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = driverNodeParams.blockDimY             # <<<<<<<<<<<<<<
 *     pNodeParams[0].blockDim.z = driverNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = driverNodeParams.sharedMemBytes
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.blockDimY;
  (__pyx_v_pNodeParams[0]).blockDim.y = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1807
 *     pNodeParams[0].blockDim.x = driverNodeParams.blockDimX
 *     pNodeParams[0].blockDim.y = driverNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = driverNodeParams.blockDimZ             # <<<<<<<<<<<<<<
 *     pNodeParams[0].sharedMemBytes = driverNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = driverNodeParams.kernelParams
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.blockDimZ;
  (__pyx_v_pNodeParams[0]).blockDim.z = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1808
 *     pNodeParams[0].blockDim.y = driverNodeParams.blockDimY
 *     pNodeParams[0].blockDim.z = driverNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = driverNodeParams.sharedMemBytes             # <<<<<<<<<<<<<<
 *     pNodeParams[0].kernelParams = driverNodeParams.kernelParams
 *     pNodeParams[0].extra = driverNodeParams.extra
 */
  __pyx_t_4 = __pyx_v_driverNodeParams.sharedMemBytes;
  (__pyx_v_pNodeParams[0]).sharedMemBytes = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1809
 *     pNodeParams[0].blockDim.z = driverNodeParams.blockDimZ
 *     pNodeParams[0].sharedMemBytes = driverNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = driverNodeParams.kernelParams             # <<<<<<<<<<<<<<
 *     pNodeParams[0].extra = driverNodeParams.extra
 * 
 */
  __pyx_t_5 = __pyx_v_driverNodeParams.kernelParams;
  (__pyx_v_pNodeParams[0]).kernelParams = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1810
 *     pNodeParams[0].sharedMemBytes = driverNodeParams.sharedMemBytes
 *     pNodeParams[0].kernelParams = driverNodeParams.kernelParams
 *     pNodeParams[0].extra = driverNodeParams.extra             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_5 = __pyx_v_driverNodeParams.extra;
  (__pyx_v_pNodeParams[0]).extra = __pyx_t_5;

  /* "cuda/_lib/ccudart/ccudart.pyx":1812
 *     pNodeParams[0].extra = driverNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1813
 * 
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1813, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1812
 *     pNodeParams[0].extra = driverNodeParams.extra
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1814
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1793
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1816
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer(void **__pyx_v_devPtr, cudaExternalMemory_t __pyx_v_extMem, struct cudaExternalMemoryBufferDesc const *__pyx_v_bufferDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_BUFFER_DESC __pyx_v__driver_bufferDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  unsigned PY_LONG_LONG __pyx_t_2;
  unsigned int __pyx_t_3;
  int __pyx_t_4;
  CUresult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaExternalMemoryGetMappedBuffer", __pyx_f[0], 1816, 1, __PYX_ERR(0, 1816, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1817
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1818
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1818, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1820
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size
 */
  (void)(memset((&__pyx_v__driver_bufferDesc), 0, (sizeof(__pyx_v__driver_bufferDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1821
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_BUFFER_DESC _driver_bufferDesc
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 *     _driver_bufferDesc.offset = bufferDesc[0].offset             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.size = bufferDesc[0].size
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 */
  __pyx_t_2 = (__pyx_v_bufferDesc[0]).offset;
  __pyx_v__driver_bufferDesc.offset = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1822
 *     memset(&_driver_bufferDesc, 0, sizeof(_driver_bufferDesc))
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size             # <<<<<<<<<<<<<<
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 * 
 */
  __pyx_t_2 = (__pyx_v_bufferDesc[0]).size;
  __pyx_v__driver_bufferDesc.size = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":1823
 *     _driver_bufferDesc.offset = bufferDesc[0].offset
 *     _driver_bufferDesc.size = bufferDesc[0].size
 *     _driver_bufferDesc.flags = bufferDesc[0].flags             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_3 = (__pyx_v_bufferDesc[0]).flags;
  __pyx_v__driver_bufferDesc.flags = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":1825
 *     _driver_bufferDesc.flags = bufferDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 */
  __pyx_t_4 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1826
 * 
 *     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":1825
 *     _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":1827
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_5 = __pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer(((CUdeviceptr *)__pyx_v_devPtr), ((CUexternalMemory)__pyx_v_extMem), (&__pyx_v__driver_bufferDesc)); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1827, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_5);

  /* "cuda/_lib/ccudart/ccudart.pyx":1828
 *         return err
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_4 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_4) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1829
 *     err = <cudaError_t>ccuda._cuExternalMemoryGetMappedBuffer(<ccuda.CUdeviceptr*>devPtr, <ccuda.CUexternalMemory>extMem, &_driver_bufferDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1829, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1828
 *         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":1830
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1816
 *     return err
 * 
 * cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaExternalMemoryGetMappedBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1832
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory(cudaExternalMemory_t *__pyx_v_extMem_out, struct cudaExternalMemoryHandleDesc const *__pyx_v_memHandleDesc) {
  cudaError_t __pyx_v_err;
  CUDA_EXTERNAL_MEMORY_HANDLE_DESC __pyx_v__driver_memHandleDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  void *__pyx_t_4;
  void const *__pyx_t_5;
  void const *__pyx_t_6;
  unsigned PY_LONG_LONG __pyx_t_7;
  unsigned int __pyx_t_8;
  CUresult __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaImportExternalMemory", __pyx_f[0], 1832, 1, __PYX_ERR(0, 1832, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1833
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1834
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1834, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1836
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUDA_EXTERNAL_MEMORY_HANDLE_DESC _driver_memHandleDesc
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))             # <<<<<<<<<<<<<<
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 */
  (void)(memset((&__pyx_v__driver_memHandleDesc), 0, (sizeof(__pyx_v__driver_memHandleDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1838
 *     memset(&_driver_memHandleDesc, 0, sizeof(_driver_memHandleDesc))
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueFd);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1839
 * 
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD;

    /* "cuda/_lib/ccudart/ccudart.pyx":1840
 *     if memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 */
    __pyx_t_3 = (__pyx_v_memHandleDesc[0]).handle.fd;
    __pyx_v__driver_memHandleDesc.handle.fd = __pyx_t_3;

    /* "cuda/_lib/ccudart/ccudart.pyx":1838
 *     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":1841
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueWin32);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1842
 *         _driver_memHandleDesc.handle.fd = memHandleDesc[0].handle.fd
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32;

    /* "cuda/_lib/ccudart/ccudart.pyx":1843
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1844
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1841
 *         _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":1845
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeOpaqueWin32Kmt);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1846
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1847
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1848
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1845
 *         _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":1849
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D12Heap);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1850
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP;

    /* "cuda/_lib/ccudart/ccudart.pyx":1851
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1852
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1849
 *         _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":1853
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D12Resource);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1854
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1855
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1856
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1853
 *         _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":1857
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D11Resource);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1858
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE;

    /* "cuda/_lib/ccudart/ccudart.pyx":1859
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1860
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1857
 *         _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":1861
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeD3D11ResourceKmt);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1862
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT;

    /* "cuda/_lib/ccudart/ccudart.pyx":1863
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 */
    __pyx_t_4 = (__pyx_v_memHandleDesc[0]).handle.win32.handle;
    __pyx_v__driver_memHandleDesc.handle.win32.handle = __pyx_t_4;

    /* "cuda/_lib/ccudart/ccudart.pyx":1864
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name             # <<<<<<<<<<<<<<
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 */
    __pyx_t_5 = (__pyx_v_memHandleDesc[0]).handle.win32.name;
    __pyx_v__driver_memHandleDesc.handle.win32.name = __pyx_t_5;

    /* "cuda/_lib/ccudart/ccudart.pyx":1861
 *         _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":1865
 *         _driver_memHandleDesc.handle.win32.handle = memHandleDesc[0].handle.win32.handle
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 */
  __pyx_t_2 = ((__pyx_v_memHandleDesc[0]).type == cudaExternalMemoryHandleTypeNvSciBuf);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1866
 *         _driver_memHandleDesc.handle.win32.name = memHandleDesc[0].handle.win32.name
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF             # <<<<<<<<<<<<<<
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 */
    __pyx_v__driver_memHandleDesc.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF;

    /* "cuda/_lib/ccudart/ccudart.pyx":1867
 *     elif memHandleDesc[0].type == cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf:
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject             # <<<<<<<<<<<<<<
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 */
    __pyx_t_6 = (__pyx_v_memHandleDesc[0]).handle.nvSciBufObject;
    __pyx_v__driver_memHandleDesc.handle.nvSciBufObject = __pyx_t_6;

    /* "cuda/_lib/ccudart/ccudart.pyx":1865
 *         _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":1868
 *         _driver_memHandleDesc.type = ccuda.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size             # <<<<<<<<<<<<<<
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 */
  __pyx_t_7 = (__pyx_v_memHandleDesc[0]).size;
  __pyx_v__driver_memHandleDesc.size = __pyx_t_7;

  /* "cuda/_lib/ccudart/ccudart.pyx":1869
 *         _driver_memHandleDesc.handle.nvSciBufObject = memHandleDesc[0].handle.nvSciBufObject
 *     _driver_memHandleDesc.size = memHandleDesc[0].size
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
  __pyx_t_8 = (__pyx_v_memHandleDesc[0]).flags;
  __pyx_v__driver_memHandleDesc.flags = __pyx_t_8;

  /* "cuda/_lib/ccudart/ccudart.pyx":1871
 *     _driver_memHandleDesc.flags = memHandleDesc[0].flags
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1872
 * 
 *     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":1871
 *     _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":1873
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_9 = __pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory(((CUexternalMemory *)__pyx_v_extMem_out), (&__pyx_v__driver_memHandleDesc)); if (unlikely(__pyx_t_9 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1873, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_9);

  /* "cuda/_lib/ccudart/ccudart.pyx":1874
 *         return err
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1875
 *     err = <cudaError_t>ccuda._cuImportExternalMemory(<ccuda.CUexternalMemory*>extMem_out, &_driver_memHandleDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1875, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1874
 *         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":1876
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1832
 *     return err
 * 
 * cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaImportExternalMemory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1878
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject(cudaSurfaceObject_t *__pyx_v_pSurfObject, struct cudaResourceDesc const *__pyx_v_pResDesc) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaCreateSurfaceObject", __pyx_f[0], 1878, 1, __PYX_ERR(0, 1878, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1879
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1880
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1880, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1881
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1882
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1881
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1884
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))             # <<<<<<<<<<<<<<
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v__driver_pResDesc), 0, (sizeof(__pyx_v__driver_pResDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1885
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1885, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1886
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1887
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1887, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1888
 *     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":1886
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1890
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate(((CUsurfObject *)__pyx_v_pSurfObject), (&__pyx_v__driver_pResDesc)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1890, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1891
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1892
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1892, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1891
 * 
 *     err = <cudaError_t>ccuda._cuSurfObjectCreate(<ccuda.CUsurfObject*>pSurfObject, &_driver_pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1893
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1878
 *     return err
 * 
 * cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCreateSurfaceObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1895
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *__pyx_v_pResDesc, cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  CUDA_RESOURCE_DESC __pyx_v__driver_pResDesc;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetTextureObjectResourceDesc", __pyx_f[0], 1895, 1, __PYX_ERR(0, 1895, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1896
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1897
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1897, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1898
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1899
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1898
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1901
 *         return err
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))             # <<<<<<<<<<<<<<
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v__driver_pResDesc), 0, (sizeof(__pyx_v__driver_pResDesc))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1902
 *     cdef ccuda.CUDA_RESOURCE_DESC _driver_pResDesc
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc((&__pyx_v__driver_pResDesc), __pyx_v_pResDesc); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1902, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1903
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1904
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1904, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1905
 *     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":1903
 *     memset(&_driver_pResDesc, 0, sizeof(_driver_pResDesc))
 *     err = toDriverCudaResourceDesc(&_driver_pResDesc, pResDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1907
 *         return err
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc((&__pyx_v__driver_pResDesc), ((CUtexObject)__pyx_v_texObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1907, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1908
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1909
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1909, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1908
 * 
 *     err = <cudaError_t>ccuda._cuTexObjectGetResourceDesc(&_driver_pResDesc, <ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1910
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1895
 *     return err
 * 
 * cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetTextureObjectResourceDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1912
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerPresentFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_cudaEglFrame __pyx_v_eglframe, cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamProducerPresentFrame", __pyx_f[0], 1912, 1, __PYX_ERR(0, 1912, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1913
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1914
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1914, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1915
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1916
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1915
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1918
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame((&__pyx_v_cueglFrame), __pyx_v_eglframe); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1918, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1919
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1920
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1920, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1921
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1919
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = getDriverEglFrame(&cueglFrame, eglframe)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1922
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), __pyx_v_cueglFrame, __pyx_v_pStream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1922, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1923
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1924
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1924, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1923
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerPresentFrame(<ccuda.CUeglStreamConnection*>conn, cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1925
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1912
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerPresentFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1927
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerReturnFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_cudaEglFrame *__pyx_v_eglframe, cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamProducerReturnFrame", __pyx_f[0], 1927, 1, __PYX_ERR(0, 1927, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1928
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1929
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1929, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1930
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if eglframe == NULL:
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1931
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1930
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if eglframe == NULL:
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1932
 *     if err != cudaSuccess:
 *         return err
 *     if eglframe == NULL:             # <<<<<<<<<<<<<<
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 */
  __pyx_t_2 = (__pyx_v_eglframe == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1933
 *         return err
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
    __pyx_v_err = cudaErrorInvalidResourceHandle;

    /* "cuda/_lib/ccudart/ccudart.pyx":1934
 *     if eglframe == NULL:
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1934, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1935
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1932
 *     if err != cudaSuccess:
 *         return err
 *     if eglframe == NULL:             # <<<<<<<<<<<<<<
 *         err = cudaErrorInvalidResourceHandle
 *         _setLastError(err)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1937
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), (&__pyx_v_cueglFrame), __pyx_v_pStream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1937, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1938
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1939
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1939, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1940
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1938
 *     cdef ccuda.CUeglFrame cueglFrame
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerReturnFrame(<ccuda.CUeglStreamConnection*>conn, &cueglFrame, pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1941
 *         _setLastError(err)
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame(__pyx_v_eglframe, __pyx_v_cueglFrame); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1941, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1942
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1943
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1943, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1944
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1942
 *         return err
 *     err = getRuntimeEglFrame(eglframe, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1945
 *         _setLastError(err)
 *         return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1927
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerReturnFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1947
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedEglFrame(__pyx_t_4cuda_7ccudart_cudaEglFrame *__pyx_v_eglFrame, cudaGraphicsResource_t __pyx_v_resource, unsigned int __pyx_v_index, unsigned int __pyx_v_mipLevel) {
  cudaError_t __pyx_v_err;
  __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsResourceGetMappedEglFrame", __pyx_f[0], 1947, 1, __PYX_ERR(0, 1947, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1948
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1949
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1949, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1950
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1951
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1950
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1953
 *         return err
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_cueglFrame), 0, (sizeof(__pyx_v_cueglFrame))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1954
 *     cdef ccuda.CUeglFrame cueglFrame
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame((&__pyx_v_cueglFrame), ((CUgraphicsResource)__pyx_v_resource), __pyx_v_index, __pyx_v_mipLevel); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1954, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1955
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1956
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1956, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1957
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1955
 *     memset(&cueglFrame, 0, sizeof(cueglFrame))
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <ccuda.CUgraphicsResource>resource, index, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1958
 *         _setLastError(err)
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame(__pyx_v_eglFrame, __pyx_v_cueglFrame); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1958, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":1959
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1960
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1960, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1961
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1959
 *         return err
 *     err = getRuntimeEglFrame(eglFrame, cueglFrame)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1962
 *         _setLastError(err)
 *         return err
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1947
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsResourceGetMappedEglFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1964
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return cudaErrorNotSupported
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUSetVDPAUDevice(CYTHON_UNUSED int __pyx_v_device, CYTHON_UNUSED __pyx_t_4cuda_7ccudart_VdpDevice __pyx_v_vdpDevice, CYTHON_UNUSED __pyx_t_4cuda_7ccudart_VdpGetProcAddress *__pyx_v_vdpGetProcAddress) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaVDPAUSetVDPAUDevice", __pyx_f[0], 1964, 1, __PYX_ERR(0, 1964, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1965
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     return cudaErrorNotSupported             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaErrorNotSupported;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1964
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return cudaErrorNotSupported
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaVDPAUSetVDPAUDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1967
 *     return cudaErrorNotSupported
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *__pyx_v_memoryRequirements, cudaArray_t __pyx_v_array, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_MEMORY_REQUIREMENTS __pyx_v_driverMemoryRequirements;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaArrayGetMemoryRequirements", __pyx_f[0], 1967, 1, __PYX_ERR(0, 1967, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1968
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1970
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_memoryRequirements == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1971
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1971, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1972
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1970
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1974
 *         return cudaErrorInvalidValue
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:
 */
  (void)(memset(__pyx_v_memoryRequirements, 0, (sizeof((__pyx_v_memoryRequirements[0])))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1975
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements((&__pyx_v_driverMemoryRequirements), ((CUarray)__pyx_v_array), __pyx_v_device); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1975, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1976
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1977
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1977, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1978
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1976
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUarray>array, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1980
 *         return err
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size             # <<<<<<<<<<<<<<
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.size;
  (__pyx_v_memoryRequirements[0]).size = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1981
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.alignment;
  (__pyx_v_memoryRequirements[0]).alignment = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1982
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1967
 *     return cudaErrorNotSupported
 * 
 * cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetMemoryRequirements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":1984
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *__pyx_v_memoryRequirements, cudaMipmappedArray_t __pyx_v_mipmap, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  CUDA_ARRAY_MEMORY_REQUIREMENTS __pyx_v_driverMemoryRequirements;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMipmappedArrayGetMemoryRequirements", __pyx_f[0], 1984, 1, __PYX_ERR(0, 1984, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":1985
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":1987
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_memoryRequirements == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1988
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1988, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1989
 *     if memoryRequirements == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1987
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 *     if memoryRequirements == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1991
 *         return cudaErrorInvalidValue
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:
 */
  (void)(memset(__pyx_v_memoryRequirements, 0, (sizeof((__pyx_v_memoryRequirements[0])))));

  /* "cuda/_lib/ccudart/ccudart.pyx":1992
 * 
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements((&__pyx_v_driverMemoryRequirements), ((CUmipmappedArray)__pyx_v_mipmap), __pyx_v_device); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1992, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":1993
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":1994
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1994, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":1995
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":1993
 *     memset(memoryRequirements, 0, sizeof(memoryRequirements[0]))
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetMemoryRequirements(&driverMemoryRequirements, <ccuda.CUmipmappedArray>mipmap, device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":1997
 *         return err
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size             # <<<<<<<<<<<<<<
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.size;
  (__pyx_v_memoryRequirements[0]).size = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1998
 * 
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_4 = __pyx_v_driverMemoryRequirements.alignment;
  (__pyx_v_memoryRequirements[0]).alignment = __pyx_t_4;

  /* "cuda/_lib/ccudart/ccudart.pyx":1999
 *     memoryRequirements[0].size = driverMemoryRequirements.size
 *     memoryRequirements[0].alignment = driverMemoryRequirements.alignment
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1984
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_ARRAY_MEMORY_REQUIREMENTS driverMemoryRequirements
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMipmappedArrayGetMemoryRequirements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2001
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetAttribute(cudaStream_t __pyx_v_hStream, __pyx_t_4cuda_7ccudart_cudaStreamAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue *__pyx_v_value_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamGetAttribute", __pyx_f[0], 2001, 1, __PYX_ERR(0, 2001, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2002
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2003
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2003, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2004
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2005
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2004
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2006
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute(((CUstream)__pyx_v_hStream), ((CUstreamAttrID)__pyx_v_attr), ((CUstreamAttrValue *)__pyx_v_value_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2006, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2007
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2008
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2008, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2007
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2009
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2001
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2011
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSetAttribute(cudaStream_t __pyx_v_hStream, __pyx_t_4cuda_7ccudart_cudaStreamAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue const *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamSetAttribute", __pyx_f[0], 2011, 1, __PYX_ERR(0, 2011, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2012
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2013
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2013, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2014
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2015
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2014
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2016
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute(((CUstream)__pyx_v_hStream), ((CUstreamAttrID)__pyx_v_attr), ((CUstreamAttrValue *)__pyx_v_value)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2016, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2017
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2018
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2018, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2017
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSetAttribute(<ccuda.CUstream>hStream, <ccuda.CUstreamAttrID>attr, <ccuda.CUstreamAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2019
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2011
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2021
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetAttribute(cudaGraphNode_t __pyx_v_hNode, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue *__pyx_v_value_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphKernelNodeGetAttribute", __pyx_f[0], 2021, 1, __PYX_ERR(0, 2021, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2022
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2023
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2024
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2025
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2024
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2026
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute(((CUgraphNode)__pyx_v_hNode), ((CUkernelNodeAttrID)__pyx_v_attr), ((CUkernelNodeAttrValue *)__pyx_v_value_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2026, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2027
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2028
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2028, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2027
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeGetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2029
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2021
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2031
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetAttribute(cudaGraphNode_t __pyx_v_hNode, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID __pyx_v_attr, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue const *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphKernelNodeSetAttribute", __pyx_f[0], 2031, 1, __PYX_ERR(0, 2031, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2032
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2033
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2033, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2034
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2035
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2034
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2036
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute(((CUgraphNode)__pyx_v_hNode), ((CUkernelNodeAttrID)__pyx_v_attr), ((CUkernelNodeAttrValue *)__pyx_v_value)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2036, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2037
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2038
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2038, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2037
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetAttribute(<ccuda.CUgraphNode>hNode, <ccuda.CUkernelNodeAttrID>attr, <ccuda.CUkernelNodeAttrValue*>value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2039
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2031
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2041
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUGetDevice(int *__pyx_v_device, __pyx_t_4cuda_7ccudart_VdpDevice __pyx_v_vdpDevice, __pyx_t_4cuda_7ccudart_VdpGetProcAddress *__pyx_v_vdpGetProcAddress) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaVDPAUGetDevice", __pyx_f[0], 2041, 1, __PYX_ERR(0, 2041, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2042
 * 
 * cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2043
 * cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2043, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2044
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2045
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2044
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2046
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuVDPAUGetDevice(((CUdevice *)__pyx_v_device), __pyx_v_vdpDevice, __pyx_v_vdpGetProcAddress); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2046, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2047
 *         return err
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2048
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2048, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2047
 *         return err
 *     err = <cudaError_t>ccuda._cuVDPAUGetDevice(<ccuda.CUdevice*>device, vdpDevice, vdpGetProcAddress)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2049
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2041
 *     return err
 * 
 * cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaVDPAUGetDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2051
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsVDPAURegisterVideoSurface(struct cudaGraphicsResource **__pyx_v_resource, __pyx_t_4cuda_7ccudart_VdpVideoSurface __pyx_v_vdpSurface, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsVDPAURegisterVideoSurface", __pyx_f[0], 2051, 1, __PYX_ERR(0, 2051, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2052
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2053
 * cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2053, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2054
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2055
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2054
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2056
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterVideoSurface(((CUgraphicsResource *)__pyx_v_resource), __pyx_v_vdpSurface, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2056, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2057
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2058
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2058, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2057
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterVideoSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2059
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2051
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsVDPAURegisterVideoSurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2061
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsVDPAURegisterOutputSurface(struct cudaGraphicsResource **__pyx_v_resource, __pyx_t_4cuda_7ccudart_VdpOutputSurface __pyx_v_vdpSurface, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsVDPAURegisterOutputSurface", __pyx_f[0], 2061, 1, __PYX_ERR(0, 2061, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2062
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2063
 * cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2063, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2064
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2065
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2064
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2066
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterOutputSurface(((CUgraphicsResource *)__pyx_v_resource), __pyx_v_vdpSurface, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2066, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2067
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2068
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2068, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2067
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsVDPAURegisterOutputSurface(<ccuda.CUgraphicsResource*>resource, vdpSurface, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2069
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2061
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsVDPAURegisterOutputSurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2071
 *     return err
 * 
 * cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGLGetDevices(unsigned int *__pyx_v_pCudaDeviceCount, int *__pyx_v_pCudaDevices, unsigned int __pyx_v_cudaDeviceCount, enum __pyx_t_4cuda_7ccudart_cudaGLDeviceList __pyx_v_deviceList) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGLGetDevices", __pyx_f[0], 2071, 1, __PYX_ERR(0, 2071, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2072
 * 
 * cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2073
 * cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2073, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2074
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2075
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2074
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2076
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGLGetDevices_v2(__pyx_v_pCudaDeviceCount, ((CUdevice *)__pyx_v_pCudaDevices), __pyx_v_cudaDeviceCount, ((__pyx_t_4cuda_5ccuda_CUGLDeviceList)__pyx_v_deviceList)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2076, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2077
 *         return err
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2078
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2078, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2077
 *         return err
 *     err = <cudaError_t>ccuda._cuGLGetDevices_v2(pCudaDeviceCount, <ccuda.CUdevice*>pCudaDevices, cudaDeviceCount, <ccuda.CUGLDeviceList>deviceList)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2079
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2071
 *     return err
 * 
 * cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGLGetDevices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2081
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsGLRegisterImage(struct cudaGraphicsResource **__pyx_v_resource, __pyx_t_4cuda_7ccudart_GLuint __pyx_v_image, __pyx_t_4cuda_7ccudart_GLenum __pyx_v_target, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsGLRegisterImage", __pyx_f[0], 2081, 1, __PYX_ERR(0, 2081, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2082
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2083
 * cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2083, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2084
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2085
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2084
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2086
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterImage(((CUgraphicsResource *)__pyx_v_resource), __pyx_v_image, __pyx_v_target, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2086, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2087
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2088
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2088, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2087
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterImage(<ccuda.CUgraphicsResource*>resource, image, target, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2089
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2081
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsGLRegisterImage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2091
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsGLRegisterBuffer(struct cudaGraphicsResource **__pyx_v_resource, __pyx_t_4cuda_7ccudart_GLuint __pyx_v_buffer, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsGLRegisterBuffer", __pyx_f[0], 2091, 1, __PYX_ERR(0, 2091, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2092
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2093
 * cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2093, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2094
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2095
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2094
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2096
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterBuffer(((CUgraphicsResource *)__pyx_v_resource), __pyx_v_buffer, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2096, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2097
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2098
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2098, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2097
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsGLRegisterBuffer(<ccuda.CUgraphicsResource*>resource, buffer, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2099
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2091
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsGLRegisterBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2101
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSynchronize(void) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSynchronize", __pyx_f[0], 2101, 1, __PYX_ERR(0, 2101, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2102
 * 
 * cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2103
 * cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2103, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2104
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2105
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2104
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2106
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSynchronize(); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2106, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2107
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2108
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2108, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2107
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSynchronize()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2109
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2101
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSynchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2111
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetLimit(enum cudaLimit __pyx_v_limit, size_t __pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSetLimit", __pyx_f[0], 2111, 1, __PYX_ERR(0, 2111, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2112
 * 
 * cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2113
 * cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2113, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2114
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2115
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2114
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2116
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetLimit(((CUlimit)__pyx_v_limit), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2116, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2117
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2118
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2118, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2117
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetLimit(<ccuda.CUlimit>limit, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2119
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2111
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetLimit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2121
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetLimit(size_t *__pyx_v_pValue, enum cudaLimit __pyx_v_limit) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetLimit", __pyx_f[0], 2121, 1, __PYX_ERR(0, 2121, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2122
 * 
 * cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2123
 * cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2123, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2124
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2125
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2124
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2126
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetLimit(__pyx_v_pValue, ((CUlimit)__pyx_v_limit)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2126, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2127
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2128
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2128, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2127
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetLimit(pValue, <ccuda.CUlimit>limit)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2129
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2121
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetLimit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2131
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetCacheConfig(enum cudaFuncCache *__pyx_v_pCacheConfig) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetCacheConfig", __pyx_f[0], 2131, 1, __PYX_ERR(0, 2131, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2132
 * 
 * cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2133
 * cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2133, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2134
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2135
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2134
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2136
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCacheConfig(((CUfunc_cache *)__pyx_v_pCacheConfig)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2136, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2137
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2138
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2138, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2137
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetCacheConfig(<ccuda.CUfunc_cache*>pCacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2139
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2131
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetCacheConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2141
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetStreamPriorityRange(int *__pyx_v_leastPriority, int *__pyx_v_greatestPriority) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetStreamPriorityRange", __pyx_f[0], 2141, 1, __PYX_ERR(0, 2141, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2142
 * 
 * cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2143
 * cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2143, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2144
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2145
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2144
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2146
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetStreamPriorityRange(__pyx_v_leastPriority, __pyx_v_greatestPriority); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2146, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2147
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2148
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2148, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2147
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2149
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2141
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetStreamPriorityRange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2151
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetCacheConfig(enum cudaFuncCache __pyx_v_cacheConfig) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSetCacheConfig", __pyx_f[0], 2151, 1, __PYX_ERR(0, 2151, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2152
 * 
 * cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2153
 * cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2153, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2154
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2155
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2154
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2156
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCacheConfig(((CUfunc_cache)__pyx_v_cacheConfig)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2156, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2157
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2158
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2158, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2157
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxSetCacheConfig(<ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2159
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2151
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetCacheConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2161
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *__pyx_v_pConfig) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetSharedMemConfig", __pyx_f[0], 2161, 1, __PYX_ERR(0, 2161, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2162
 * 
 * cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2163
 * cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2163, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2164
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2165
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2164
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2166
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetSharedMemConfig(((CUsharedconfig *)__pyx_v_pConfig)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2166, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2167
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2168
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2168, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2167
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxGetSharedMemConfig(<ccuda.CUsharedconfig*>pConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2169
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2161
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetSharedMemConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2171
 *     return err
 * 
 * cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcGetEventHandle(cudaIpcEventHandle_t *__pyx_v_handle, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaIpcGetEventHandle", __pyx_f[0], 2171, 1, __PYX_ERR(0, 2171, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2172
 * 
 * cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2173
 * cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2173, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2174
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2175
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2174
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2176
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetEventHandle(((CUipcEventHandle *)__pyx_v_handle), ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2176, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2177
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2178
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2178, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2177
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetEventHandle(<ccuda.CUipcEventHandle*>handle, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2179
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2171
 *     return err
 * 
 * cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaIpcGetEventHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2181
 *     return err
 * 
 * cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcOpenEventHandle(cudaEvent_t *__pyx_v_event, cudaIpcEventHandle_t __pyx_v_handle) {
  cudaError_t __pyx_v_err;
  CUipcEventHandle __pyx_v__driver_handle;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaIpcOpenEventHandle", __pyx_f[0], 2181, 1, __PYX_ERR(0, 2181, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2182
 * 
 * cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUipcEventHandle _driver_handle
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2183
 * cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUipcEventHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2183, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2185
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUipcEventHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  (void)(memcpy((&__pyx_v__driver_handle), (&__pyx_v_handle), (sizeof(__pyx_v__driver_handle))));

  /* "cuda/_lib/ccudart/ccudart.pyx":2186
 *     cdef ccuda.CUipcEventHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2187
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2186
 *     cdef ccuda.CUipcEventHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2188
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenEventHandle(((CUevent *)__pyx_v_event), __pyx_v__driver_handle); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2188, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2189
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2190
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2190, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2189
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenEventHandle(<ccuda.CUevent*>event, _driver_handle)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2191
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2181
 *     return err
 * 
 * cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaIpcOpenEventHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2193
 *     return err
 * 
 * cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcGetMemHandle(cudaIpcMemHandle_t *__pyx_v_handle, void *__pyx_v_devPtr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaIpcGetMemHandle", __pyx_f[0], 2193, 1, __PYX_ERR(0, 2193, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2194
 * 
 * cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2195
 * cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2195, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2196
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2197
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2196
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2198
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetMemHandle(((CUipcMemHandle *)__pyx_v_handle), ((CUdeviceptr)__pyx_v_devPtr)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2198, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2199
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2200
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2200, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2199
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcGetMemHandle(<ccuda.CUipcMemHandle*>handle, <ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2201
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2193
 *     return err
 * 
 * cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaIpcGetMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2203
 *     return err
 * 
 * cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcOpenMemHandle(void **__pyx_v_devPtr, cudaIpcMemHandle_t __pyx_v_handle, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  CUipcMemHandle __pyx_v__driver_handle;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaIpcOpenMemHandle", __pyx_f[0], 2203, 1, __PYX_ERR(0, 2203, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2204
 * 
 * cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUipcMemHandle _driver_handle
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2205
 * cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUipcMemHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2205, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2207
 *     err = m_global.lazyInitContextState()
 *     cdef ccuda.CUipcMemHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  (void)(memcpy((&__pyx_v__driver_handle), (&__pyx_v_handle), (sizeof(__pyx_v__driver_handle))));

  /* "cuda/_lib/ccudart/ccudart.pyx":2208
 *     cdef ccuda.CUipcMemHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2209
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2208
 *     cdef ccuda.CUipcMemHandle _driver_handle
 *     memcpy(&_driver_handle, &handle, sizeof(_driver_handle))
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2210
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenMemHandle_v2(((CUdeviceptr *)__pyx_v_devPtr), __pyx_v__driver_handle, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2210, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2211
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2212
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2212, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2211
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcOpenMemHandle_v2(<ccuda.CUdeviceptr*>devPtr, _driver_handle, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2213
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2203
 *     return err
 * 
 * cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaIpcOpenMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2215
 *     return err
 * 
 * cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcCloseMemHandle(void *__pyx_v_devPtr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaIpcCloseMemHandle", __pyx_f[0], 2215, 1, __PYX_ERR(0, 2215, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2216
 * 
 * cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2217
 * cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2217, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2218
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2219
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2218
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2220
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuIpcCloseMemHandle(((CUdeviceptr)__pyx_v_devPtr)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2220, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2221
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2222
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2222, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2221
 *         return err
 *     err = <cudaError_t>ccuda._cuIpcCloseMemHandle(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2223
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2215
 *     return err
 * 
 * cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaIpcCloseMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2225
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget __pyx_v_target, enum cudaFlushGPUDirectRDMAWritesScope __pyx_v_scope) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceFlushGPUDirectRDMAWrites", __pyx_f[0], 2225, 1, __PYX_ERR(0, 2225, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2226
 * 
 * cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2227
 * cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2227, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2228
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2229
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2228
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2230
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFlushGPUDirectRDMAWrites(((CUflushGPUDirectRDMAWritesTarget)__pyx_v_target), ((CUflushGPUDirectRDMAWritesScope)__pyx_v_scope)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2230, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2231
 *         return err
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2232
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2232, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2231
 *         return err
 *     err = <cudaError_t>ccuda._cuFlushGPUDirectRDMAWrites(<ccuda.CUflushGPUDirectRDMAWritesTarget>target, <ccuda.CUflushGPUDirectRDMAWritesScope>scope)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2233
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2225
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceFlushGPUDirectRDMAWrites", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2235
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetDefaultMemPool(cudaMemPool_t *__pyx_v_memPool, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetDefaultMemPool", __pyx_f[0], 2235, 1, __PYX_ERR(0, 2235, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2236
 * 
 * cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2237
 * cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2237, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2238
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2239
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2238
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2240
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetDefaultMemPool(((CUmemoryPool *)__pyx_v_memPool), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2240, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2241
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2242
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2242, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2241
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetDefaultMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2243
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2235
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetDefaultMemPool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2245
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetMemPool(int __pyx_v_device, cudaMemPool_t __pyx_v_memPool) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSetMemPool", __pyx_f[0], 2245, 1, __PYX_ERR(0, 2245, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2246
 * 
 * cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2247
 * cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2247, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2248
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2249
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2248
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2250
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetMemPool(((CUdevice)__pyx_v_device), ((CUmemoryPool)__pyx_v_memPool)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2250, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2251
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2252
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2252, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2251
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetMemPool(<ccuda.CUdevice>device, <ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2253
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2245
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetMemPool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2255
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetMemPool(cudaMemPool_t *__pyx_v_memPool, int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetMemPool", __pyx_f[0], 2255, 1, __PYX_ERR(0, 2255, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2256
 * 
 * cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2257
 * cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2257, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2258
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2259
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2258
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2260
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetMemPool(((CUmemoryPool *)__pyx_v_memPool), ((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2260, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2261
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2262
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2262, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2261
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetMemPool(<ccuda.CUmemoryPool*>memPool, <ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2263
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2255
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetMemPool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2265
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetNvSciSyncAttributes(void *__pyx_v_nvSciSyncAttrList, int __pyx_v_device, int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetNvSciSyncAttributes", __pyx_f[0], 2265, 1, __PYX_ERR(0, 2265, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2266
 * 
 * cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2267
 * cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2267, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2268
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2269
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2268
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2270
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetNvSciSyncAttributes(__pyx_v_nvSciSyncAttrList, ((CUdevice)__pyx_v_device), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2270, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2271
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2272
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2272, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2271
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, <ccuda.CUdevice>device, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2273
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2265
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetNvSciSyncAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2275
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreateWithFlags(cudaStream_t *__pyx_v_pStream, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamCreateWithFlags", __pyx_f[0], 2275, 1, __PYX_ERR(0, 2275, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2276
 * 
 * cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2277
 * cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2277, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2278
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2279
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2278
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2280
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate(((CUstream *)__pyx_v_pStream), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2280, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2281
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2282
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2282, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2281
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreate(<ccuda.CUstream*>pStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2283
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2275
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamCreateWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2285
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreateWithPriority(cudaStream_t *__pyx_v_pStream, unsigned int __pyx_v_flags, int __pyx_v_priority) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamCreateWithPriority", __pyx_f[0], 2285, 1, __PYX_ERR(0, 2285, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2286
 * 
 * cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2287
 * cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2287, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2288
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2289
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2288
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2290
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreateWithPriority(((CUstream *)__pyx_v_pStream), __pyx_v_flags, __pyx_v_priority); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2290, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2291
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2292
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2292, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2291
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCreateWithPriority(<ccuda.CUstream*>pStream, flags, priority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2293
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2285
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamCreateWithPriority", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2295
 *     return err
 * 
 * cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetPriority(cudaStream_t __pyx_v_hStream, int *__pyx_v_priority) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamGetPriority", __pyx_f[0], 2295, 1, __PYX_ERR(0, 2295, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2296
 * 
 * cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2297
 * cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2297, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2298
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2299
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2298
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2300
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetPriority(((CUstream)__pyx_v_hStream), __pyx_v_priority); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2300, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2301
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2302
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2302, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2301
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetPriority(<ccuda.CUstream>hStream, priority)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2303
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2295
 *     return err
 * 
 * cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetPriority", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2305
 *     return err
 * 
 * cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetFlags(cudaStream_t __pyx_v_hStream, unsigned int *__pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamGetFlags", __pyx_f[0], 2305, 1, __PYX_ERR(0, 2305, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2306
 * 
 * cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2307
 * cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2307, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2308
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2309
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2308
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2310
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetFlags(((CUstream)__pyx_v_hStream), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2310, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2311
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2312
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2312, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2311
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetFlags(<ccuda.CUstream>hStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2313
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2305
 *     return err
 * 
 * cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2315
 *     return err
 * 
 * cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCtxResetPersistingL2Cache(void) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaCtxResetPersistingL2Cache", __pyx_f[0], 2315, 1, __PYX_ERR(0, 2315, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2316
 * 
 * cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2317
 * cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2317, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2318
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2319
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2318
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2320
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxResetPersistingL2Cache(); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2320, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2321
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2322
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2322, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2321
 *         return err
 *     err = <cudaError_t>ccuda._cuCtxResetPersistingL2Cache()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2323
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2315
 *     return err
 * 
 * cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaCtxResetPersistingL2Cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2325
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCopyAttributes(cudaStream_t __pyx_v_dst, cudaStream_t __pyx_v_src) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamCopyAttributes", __pyx_f[0], 2325, 1, __PYX_ERR(0, 2325, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2326
 * 
 * cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2327
 * cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2327, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2328
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2329
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2328
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2330
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamCopyAttributes(((CUstream)__pyx_v_dst), ((CUstream)__pyx_v_src)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2330, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2331
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2332
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2332, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2331
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamCopyAttributes(<ccuda.CUstream>dst, <ccuda.CUstream>src)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2333
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2325
 *     return err
 * 
 * cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamCopyAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2335
 *     return err
 * 
 * cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamDestroy(cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamDestroy", __pyx_f[0], 2335, 1, __PYX_ERR(0, 2335, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2336
 * 
 * cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2337
 * cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2337, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2338
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2339
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2338
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2340
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamDestroy_v2(((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2340, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2341
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2342
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2342, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2341
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamDestroy_v2(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2343
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2335
 *     return err
 * 
 * cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2345
 *     return err
 * 
 * cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamWaitEvent(cudaStream_t __pyx_v_stream, cudaEvent_t __pyx_v_event, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamWaitEvent", __pyx_f[0], 2345, 1, __PYX_ERR(0, 2345, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2346
 * 
 * cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2347
 * cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2347, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2348
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2349
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2348
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2350
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamWaitEvent(((CUstream)__pyx_v_stream), ((CUevent)__pyx_v_event), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2350, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2351
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2352
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2352, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2351
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamWaitEvent(<ccuda.CUstream>stream, <ccuda.CUevent>event, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2353
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2345
 *     return err
 * 
 * cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamWaitEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2355
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSynchronize(cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamSynchronize", __pyx_f[0], 2355, 1, __PYX_ERR(0, 2355, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2356
 * 
 * cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2357
 * cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2357, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2358
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2359
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2358
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2360
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamSynchronize(((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2360, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2361
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2362
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2362, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2361
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamSynchronize(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2363
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2355
 *     return err
 * 
 * cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamSynchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2365
 *     return err
 * 
 * cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamQuery(cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamQuery", __pyx_f[0], 2365, 1, __PYX_ERR(0, 2365, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2366
 * 
 * cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2367
 * cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2367, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2368
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2369
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2368
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2370
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamQuery(((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2370, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2371
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2372
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2372, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2371
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamQuery(<ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2373
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2365
 *     return err
 * 
 * cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamQuery", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2375
 *     return err
 * 
 * cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAttachMemAsync(cudaStream_t __pyx_v_stream, void *__pyx_v_devPtr, size_t __pyx_v_length, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamAttachMemAsync", __pyx_f[0], 2375, 1, __PYX_ERR(0, 2375, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2376
 * 
 * cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2377
 * cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2377, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2378
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2379
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2378
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2380
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamAttachMemAsync(((CUstream)__pyx_v_stream), ((CUdeviceptr)__pyx_v_devPtr), __pyx_v_length, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2380, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2381
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2382
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2382, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2381
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamAttachMemAsync(<ccuda.CUstream>stream, <ccuda.CUdeviceptr>devPtr, length, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2383
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2375
 *     return err
 * 
 * cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamAttachMemAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2385
 *     return err
 * 
 * cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamBeginCapture(cudaStream_t __pyx_v_stream, enum cudaStreamCaptureMode __pyx_v_mode) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamBeginCapture", __pyx_f[0], 2385, 1, __PYX_ERR(0, 2385, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2386
 * 
 * cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2387
 * cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2387, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2388
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2389
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2388
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2390
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamBeginCapture_v2(((CUstream)__pyx_v_stream), ((CUstreamCaptureMode)__pyx_v_mode)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2390, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2391
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2392
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2392, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2391
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamBeginCapture_v2(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureMode>mode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2393
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2385
 *     return err
 * 
 * cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamBeginCapture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2395
 *     return err
 * 
 * cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *__pyx_v_mode) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaThreadExchangeStreamCaptureMode", __pyx_f[0], 2395, 1, __PYX_ERR(0, 2395, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2396
 * 
 * cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2397
 * cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2397, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2398
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2399
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2398
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2400
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuThreadExchangeStreamCaptureMode(((CUstreamCaptureMode *)__pyx_v_mode)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2400, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2401
 *         return err
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2402
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2402, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2401
 *         return err
 *     err = <cudaError_t>ccuda._cuThreadExchangeStreamCaptureMode(<ccuda.CUstreamCaptureMode*>mode)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2403
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2395
 *     return err
 * 
 * cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaThreadExchangeStreamCaptureMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2405
 *     return err
 * 
 * cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamEndCapture(cudaStream_t __pyx_v_stream, cudaGraph_t *__pyx_v_pGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamEndCapture", __pyx_f[0], 2405, 1, __PYX_ERR(0, 2405, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2406
 * 
 * cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2407
 * cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2407, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2408
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2409
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2408
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2410
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamEndCapture(((CUstream)__pyx_v_stream), ((CUgraph *)__pyx_v_pGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2410, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2411
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2412
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2412, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2411
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamEndCapture(<ccuda.CUstream>stream, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2413
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2405
 *     return err
 * 
 * cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamEndCapture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2415
 *     return err
 * 
 * cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamIsCapturing(cudaStream_t __pyx_v_stream, enum cudaStreamCaptureStatus *__pyx_v_pCaptureStatus) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamIsCapturing", __pyx_f[0], 2415, 1, __PYX_ERR(0, 2415, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2416
 * 
 * cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2417
 * cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2417, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2418
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2419
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2418
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2420
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamIsCapturing(((CUstream)__pyx_v_stream), ((CUstreamCaptureStatus *)__pyx_v_pCaptureStatus)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2420, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2421
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2422
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2422, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2421
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamIsCapturing(<ccuda.CUstream>stream, <ccuda.CUstreamCaptureStatus*>pCaptureStatus)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2423
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2415
 *     return err
 * 
 * cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamIsCapturing", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2425
 *     return err
 * 
 * cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamUpdateCaptureDependencies(cudaStream_t __pyx_v_stream, cudaGraphNode_t *__pyx_v_dependencies, size_t __pyx_v_numDependencies, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamUpdateCaptureDependencies", __pyx_f[0], 2425, 1, __PYX_ERR(0, 2425, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2426
 * 
 * cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2427
 * cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2427, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2428
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2429
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2428
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2430
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamUpdateCaptureDependencies(((CUstream)__pyx_v_stream), ((CUgraphNode *)__pyx_v_dependencies), __pyx_v_numDependencies, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2430, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2431
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2432
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2432, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2431
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamUpdateCaptureDependencies(<ccuda.CUstream>stream, <ccuda.CUgraphNode*>dependencies, numDependencies, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2433
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2425
 *     return err
 * 
 * cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamUpdateCaptureDependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2435
 *     return err
 * 
 * cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreateWithFlags(cudaEvent_t *__pyx_v_event, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventCreateWithFlags", __pyx_f[0], 2435, 1, __PYX_ERR(0, 2435, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2436
 * 
 * cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2437
 * cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2437, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2438
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2439
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2438
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2440
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate(((CUevent *)__pyx_v_event), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2440, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2441
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2442
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2442, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2441
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreate(<ccuda.CUevent*>event, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2443
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2435
 *     return err
 * 
 * cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventCreateWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2445
 *     return err
 * 
 * cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventRecord(cudaEvent_t __pyx_v_event, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventRecord", __pyx_f[0], 2445, 1, __PYX_ERR(0, 2445, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2446
 * 
 * cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2447
 * cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2447, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2448
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2449
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2448
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2450
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventRecord(((CUevent)__pyx_v_event), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2450, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2451
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2452
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2452, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2451
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecord(<ccuda.CUevent>event, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2453
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2445
 *     return err
 * 
 * cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventRecord", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2455
 *     return err
 * 
 * cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventRecordWithFlags(cudaEvent_t __pyx_v_event, cudaStream_t __pyx_v_stream, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventRecordWithFlags", __pyx_f[0], 2455, 1, __PYX_ERR(0, 2455, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2456
 * 
 * cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2457
 * cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2457, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2458
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2459
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2458
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2460
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventRecordWithFlags(((CUevent)__pyx_v_event), ((CUstream)__pyx_v_stream), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2460, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2461
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2462
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2462, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2461
 *         return err
 *     err = <cudaError_t>ccuda._cuEventRecordWithFlags(<ccuda.CUevent>event, <ccuda.CUstream>stream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2463
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2455
 *     return err
 * 
 * cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventRecordWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2465
 *     return err
 * 
 * cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventSynchronize(cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventSynchronize", __pyx_f[0], 2465, 1, __PYX_ERR(0, 2465, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2466
 * 
 * cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2467
 * cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2467, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2468
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2469
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2468
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2470
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventSynchronize(((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2470, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2471
 *         return err
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2472
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2472, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2471
 *         return err
 *     err = <cudaError_t>ccuda._cuEventSynchronize(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2473
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2465
 *     return err
 * 
 * cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventSynchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2475
 *     return err
 * 
 * cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventDestroy(cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventDestroy", __pyx_f[0], 2475, 1, __PYX_ERR(0, 2475, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2476
 * 
 * cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2477
 * cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2477, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2478
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2479
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2478
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2480
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventDestroy_v2(((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2480, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2481
 *         return err
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2482
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2482, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2481
 *         return err
 *     err = <cudaError_t>ccuda._cuEventDestroy_v2(<ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2483
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2475
 *     return err
 * 
 * cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2485
 *     return err
 * 
 * cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventElapsedTime(float *__pyx_v_ms, cudaEvent_t __pyx_v_start, cudaEvent_t __pyx_v_end) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventElapsedTime", __pyx_f[0], 2485, 1, __PYX_ERR(0, 2485, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2486
 * 
 * cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2487
 * cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2487, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2488
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2489
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2488
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2490
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventElapsedTime(__pyx_v_ms, ((CUevent)__pyx_v_start), ((CUevent)__pyx_v_end)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2490, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2491
 *         return err
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2492
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2492, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2491
 *         return err
 *     err = <cudaError_t>ccuda._cuEventElapsedTime(ms, <ccuda.CUevent>start, <ccuda.CUevent>end)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2493
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2485
 *     return err
 * 
 * cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventElapsedTime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2495
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyExternalMemory(cudaExternalMemory_t __pyx_v_extMem) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDestroyExternalMemory", __pyx_f[0], 2495, 1, __PYX_ERR(0, 2495, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2496
 * 
 * cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2497
 * cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2497, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2498
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2499
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2498
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2500
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalMemory(((CUexternalMemory)__pyx_v_extMem)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2500, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2501
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2502
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2502, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2501
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalMemory(<ccuda.CUexternalMemory>extMem)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2503
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2495
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDestroyExternalMemory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2505
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyExternalSemaphore(cudaExternalSemaphore_t __pyx_v_extSem) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDestroyExternalSemaphore", __pyx_f[0], 2505, 1, __PYX_ERR(0, 2505, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2506
 * 
 * cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2507
 * cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2507, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2508
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2509
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2508
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2510
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalSemaphore(((CUexternalSemaphore)__pyx_v_extSem)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2510, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2511
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2512
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2512, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2511
 *         return err
 *     err = <cudaError_t>ccuda._cuDestroyExternalSemaphore(<ccuda.CUexternalSemaphore>extSem)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2513
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2505
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDestroyExternalSemaphore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2515
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetCacheConfig(void const *__pyx_v_func, enum cudaFuncCache __pyx_v_cacheConfig) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFuncSetCacheConfig", __pyx_f[0], 2515, 1, __PYX_ERR(0, 2515, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2516
 * 
 * cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2517
 * cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2517, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2518
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2519
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2518
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2520
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetCacheConfig(((CUfunction)__pyx_v_func), ((CUfunc_cache)__pyx_v_cacheConfig)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2520, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2521
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2522
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2522, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2521
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetCacheConfig(<ccuda.CUfunction>func, <ccuda.CUfunc_cache>cacheConfig)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2523
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2515
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFuncSetCacheConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2525
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetSharedMemConfig(void const *__pyx_v_func, enum cudaSharedMemConfig __pyx_v_config) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFuncSetSharedMemConfig", __pyx_f[0], 2525, 1, __PYX_ERR(0, 2525, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2526
 * 
 * cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2527
 * cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2527, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2528
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2529
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2528
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2530
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetSharedMemConfig(((CUfunction)__pyx_v_func), ((CUsharedconfig)__pyx_v_config)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2530, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2531
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2532
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2532, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2531
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetSharedMemConfig(<ccuda.CUfunction>func, <ccuda.CUsharedconfig>config)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2533
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2525
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFuncSetSharedMemConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2535
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetAttribute(void const *__pyx_v_func, enum cudaFuncAttribute __pyx_v_attr, int __pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFuncSetAttribute", __pyx_f[0], 2535, 1, __PYX_ERR(0, 2535, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2536
 * 
 * cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2537
 * cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2537, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2538
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2539
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2538
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2540
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetAttribute(((CUfunction)__pyx_v_func), ((CUfunction_attribute)__pyx_v_attr), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2540, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2541
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2542
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2542, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2541
 *         return err
 *     err = <cudaError_t>ccuda._cuFuncSetAttribute(<ccuda.CUfunction>func, <ccuda.CUfunction_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2543
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2535
 *     return err
 * 
 * cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFuncSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2545
 *     return err
 * 
 * cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaLaunchHostFunc(cudaStream_t __pyx_v_stream, cudaHostFn_t __pyx_v_fn, void *__pyx_v_userData) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaLaunchHostFunc", __pyx_f[0], 2545, 1, __PYX_ERR(0, 2545, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2546
 * 
 * cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2547
 * cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2547, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2548
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2549
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2548
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2550
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuLaunchHostFunc(((CUstream)__pyx_v_stream), ((CUhostFn)__pyx_v_fn), __pyx_v_userData); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2550, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2551
 *         return err
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2552
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2552, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2551
 *         return err
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>fn, userData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2553
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2545
 *     return err
 * 
 * cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaLaunchHostFunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2555
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *__pyx_v_numBlocks, void const *__pyx_v_func, int __pyx_v_blockSize, size_t __pyx_v_dynamicSMemSize) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaOccupancyMaxActiveBlocksPerMultiprocessor", __pyx_f[0], 2555, 1, __PYX_ERR(0, 2555, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2556
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2557
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2557, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2558
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2559
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2558
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2560
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessor(__pyx_v_numBlocks, ((CUfunction)__pyx_v_func), __pyx_v_blockSize, __pyx_v_dynamicSMemSize); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2560, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2561
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2562
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2562, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2561
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2563
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2555
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaOccupancyMaxActiveBlocksPerMultiprocessor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2565
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyAvailableDynamicSMemPerBlock(size_t *__pyx_v_dynamicSmemSize, void const *__pyx_v_func, int __pyx_v_numBlocks, int __pyx_v_blockSize) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaOccupancyAvailableDynamicSMemPerBlock", __pyx_f[0], 2565, 1, __PYX_ERR(0, 2565, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2566
 * 
 * cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2567
 * cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2567, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2568
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2569
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2568
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2570
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyAvailableDynamicSMemPerBlock(__pyx_v_dynamicSmemSize, ((CUfunction)__pyx_v_func), __pyx_v_numBlocks, __pyx_v_blockSize); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2570, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2571
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2572
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2572, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2571
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, <ccuda.CUfunction>func, numBlocks, blockSize)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2573
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2565
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaOccupancyAvailableDynamicSMemPerBlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2575
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *__pyx_v_numBlocks, void const *__pyx_v_func, int __pyx_v_blockSize, size_t __pyx_v_dynamicSMemSize, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", __pyx_f[0], 2575, 1, __PYX_ERR(0, 2575, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2576
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2577
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2577, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2578
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2579
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2578
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2580
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(__pyx_v_numBlocks, ((CUfunction)__pyx_v_func), __pyx_v_blockSize, __pyx_v_dynamicSMemSize, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2580, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2581
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2582
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2582, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2581
 *         return err
 *     err = <cudaError_t>ccuda._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, <ccuda.CUfunction>func, blockSize, dynamicSMemSize, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2583
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2575
 *     return err
 * 
 * cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2585
 *     return err
 * 
 * cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocManaged(void **__pyx_v_devPtr, size_t __pyx_v_size, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMallocManaged", __pyx_f[0], 2585, 1, __PYX_ERR(0, 2585, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2586
 * 
 * cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2587
 * cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2587, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2588
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2589
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2588
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2590
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocManaged(((CUdeviceptr *)__pyx_v_devPtr), __pyx_v_size, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2590, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2591
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2592
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2592, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2591
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocManaged(<ccuda.CUdeviceptr*>devPtr, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2593
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2585
 *     return err
 * 
 * cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocManaged", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2595
 *     return err
 * 
 * cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc(void **__pyx_v_devPtr, size_t __pyx_v_size) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMalloc", __pyx_f[0], 2595, 1, __PYX_ERR(0, 2595, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2596
 * 
 * cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2597
 * cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2597, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2598
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2599
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2598
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2600
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAlloc_v2(((CUdeviceptr *)__pyx_v_devPtr), __pyx_v_size); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2600, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2601
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2602
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2602, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2601
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAlloc_v2(<ccuda.CUdeviceptr*>devPtr, size)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2603
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2595
 *     return err
 * 
 * cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMalloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2605
 *     return err
 * 
 * cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFree(void *__pyx_v_devPtr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFree", __pyx_f[0], 2605, 1, __PYX_ERR(0, 2605, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2606
 * 
 * cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2607
 * cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2607, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2608
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2609
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2608
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2610
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemFree_v2(((CUdeviceptr)__pyx_v_devPtr)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2610, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2611
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2612
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2612, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2611
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFree_v2(<ccuda.CUdeviceptr>devPtr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2613
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2605
 *     return err
 * 
 * cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2615
 *     return err
 * 
 * cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeHost(void *__pyx_v_ptr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFreeHost", __pyx_f[0], 2615, 1, __PYX_ERR(0, 2615, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2616
 * 
 * cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2617
 * cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2617, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2618
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2619
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2618
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2620
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeHost(__pyx_v_ptr); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2620, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2621
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2622
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2622, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2621
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeHost(ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2623
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2615
 *     return err
 * 
 * cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFreeHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2625
 *     return err
 * 
 * cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeArray(cudaArray_t __pyx_v_array) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFreeArray", __pyx_f[0], 2625, 1, __PYX_ERR(0, 2625, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2626
 * 
 * cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2627
 * cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2627, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2628
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2629
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2628
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2630
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayDestroy(((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2630, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2631
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2632
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2632, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2631
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayDestroy(<ccuda.CUarray>array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2633
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2625
 *     return err
 * 
 * cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFreeArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2635
 *     return err
 * 
 * cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeMipmappedArray(cudaMipmappedArray_t __pyx_v_mipmappedArray) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFreeMipmappedArray", __pyx_f[0], 2635, 1, __PYX_ERR(0, 2635, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2636
 * 
 * cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2637
 * cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2637, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2638
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2639
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2638
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2640
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayDestroy(((CUmipmappedArray)__pyx_v_mipmappedArray)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2640, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2641
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2642
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2642, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2641
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayDestroy(<ccuda.CUmipmappedArray>mipmappedArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2643
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2635
 *     return err
 * 
 * cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFreeMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2645
 *     return err
 * 
 * cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostAlloc(void **__pyx_v_pHost, size_t __pyx_v_size, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaHostAlloc", __pyx_f[0], 2645, 1, __PYX_ERR(0, 2645, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2646
 * 
 * cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2647
 * cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2647, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2648
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2649
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2648
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2650
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostAlloc(__pyx_v_pHost, __pyx_v_size, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2650, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2651
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2652
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2652, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2651
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostAlloc(pHost, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2653
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2645
 *     return err
 * 
 * cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaHostAlloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2655
 *     return err
 * 
 * cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostRegister(void *__pyx_v_ptr, size_t __pyx_v_size, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaHostRegister", __pyx_f[0], 2655, 1, __PYX_ERR(0, 2655, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2656
 * 
 * cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2657
 * cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2657, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2658
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2659
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2658
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2660
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostRegister_v2(__pyx_v_ptr, __pyx_v_size, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2660, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2661
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2662
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2662, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2661
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostRegister_v2(ptr, size, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2663
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2655
 *     return err
 * 
 * cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaHostRegister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2665
 *     return err
 * 
 * cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostUnregister(void *__pyx_v_ptr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaHostUnregister", __pyx_f[0], 2665, 1, __PYX_ERR(0, 2665, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2666
 * 
 * cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2667
 * cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2667, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2668
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2669
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2668
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2670
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostUnregister(__pyx_v_ptr); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2670, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2671
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2672
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2672, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2671
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostUnregister(ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2673
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2665
 *     return err
 * 
 * cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaHostUnregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2675
 *     return err
 * 
 * cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostGetDevicePointer(void **__pyx_v_pDevice, void *__pyx_v_pHost, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaHostGetDevicePointer", __pyx_f[0], 2675, 1, __PYX_ERR(0, 2675, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2676
 * 
 * cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2677
 * cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2677, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2678
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2679
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2678
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2680
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetDevicePointer_v2(((CUdeviceptr *)__pyx_v_pDevice), __pyx_v_pHost, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2680, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2681
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2682
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2682, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2681
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetDevicePointer_v2(<ccuda.CUdeviceptr*>pDevice, pHost, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2683
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2675
 *     return err
 * 
 * cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaHostGetDevicePointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2685
 *     return err
 * 
 * cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostGetFlags(unsigned int *__pyx_v_pFlags, void *__pyx_v_pHost) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaHostGetFlags", __pyx_f[0], 2685, 1, __PYX_ERR(0, 2685, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2686
 * 
 * cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2687
 * cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2687, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2688
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2689
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2688
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2690
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetFlags(__pyx_v_pFlags, __pyx_v_pHost); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2690, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2691
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2692
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2692, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2691
 *         return err
 *     err = <cudaError_t>ccuda._cuMemHostGetFlags(pFlags, pHost)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2693
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2685
 *     return err
 * 
 * cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaHostGetFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2695
 *     return err
 * 
 * cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetMipmappedArrayLevel(cudaArray_t *__pyx_v_levelArray, cudaMipmappedArray_const_t __pyx_v_mipmappedArray, unsigned int __pyx_v_level) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetMipmappedArrayLevel", __pyx_f[0], 2695, 1, __PYX_ERR(0, 2695, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2696
 * 
 * cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2697
 * cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2697, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2698
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2699
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2698
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2700
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel(((CUarray *)__pyx_v_levelArray), ((CUmipmappedArray)__pyx_v_mipmappedArray), __pyx_v_level); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2700, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2701
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2702
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2702, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2701
 *         return err
 *     err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(<ccuda.CUarray*>levelArray, <ccuda.CUmipmappedArray>mipmappedArray, level)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2703
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2695
 *     return err
 * 
 * cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetMipmappedArrayLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2705
 *     return err
 * 
 * cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemGetInfo(size_t *__pyx_v_free, size_t *__pyx_v_total) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemGetInfo", __pyx_f[0], 2705, 1, __PYX_ERR(0, 2705, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2706
 * 
 * cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2707
 * cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2708
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2709
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2708
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2710
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemGetInfo_v2(__pyx_v_free, __pyx_v_total); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2710, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2711
 *         return err
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2712
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2712, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2711
 *         return err
 *     err = <cudaError_t>ccuda._cuMemGetInfo_v2(free, total)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2713
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2705
 *     return err
 * 
 * cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemGetInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2715
 *     return err
 * 
 * cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetPlane(cudaArray_t *__pyx_v_pPlaneArray, cudaArray_t __pyx_v_hArray, unsigned int __pyx_v_planeIdx) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaArrayGetPlane", __pyx_f[0], 2715, 1, __PYX_ERR(0, 2715, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2716
 * 
 * cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2717
 * cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2717, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2718
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2719
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2718
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2720
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetPlane(((CUarray *)__pyx_v_pPlaneArray), ((CUarray)__pyx_v_hArray), __pyx_v_planeIdx); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2720, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2721
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2722
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2722, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2721
 *         return err
 *     err = <cudaError_t>ccuda._cuArrayGetPlane(<ccuda.CUarray*>pPlaneArray, <ccuda.CUarray>hArray, planeIdx)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2723
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2715
 *     return err
 * 
 * cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaArrayGetPlane", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2725
 *     return err
 * 
 * cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset(void *__pyx_v_devPtr, int __pyx_v_value, size_t __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemset", __pyx_f[0], 2725, 1, __PYX_ERR(0, 2725, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2726
 * 
 * cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2727
 * cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2727, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2728
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2729
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2728
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2730
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8_v2(((CUdeviceptr)__pyx_v_devPtr), ((unsigned char)__pyx_v_value), __pyx_v_count); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2730, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2731
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2732
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2732, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2731
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2733
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2725
 *     return err
 * 
 * cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2735
 *     return err
 * 
 * cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset2D(void *__pyx_v_devPtr, size_t __pyx_v_pitch, int __pyx_v_value, size_t __pyx_v_width, size_t __pyx_v_height) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemset2D", __pyx_f[0], 2735, 1, __PYX_ERR(0, 2735, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2736
 * 
 * cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2737
 * cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2737, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2738
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2739
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2738
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2740
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8_v2(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_pitch, ((unsigned char)__pyx_v_value), __pyx_v_width, __pyx_v_height); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2740, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2741
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2742
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2742, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2741
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2743
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2735
 *     return err
 * 
 * cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemset2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2745
 *     return err
 * 
 * cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemsetAsync(void *__pyx_v_devPtr, int __pyx_v_value, size_t __pyx_v_count, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemsetAsync", __pyx_f[0], 2745, 1, __PYX_ERR(0, 2745, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2746
 * 
 * cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2747
 * cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2747, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2748
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2749
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2748
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2750
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8Async(((CUdeviceptr)__pyx_v_devPtr), ((unsigned char)__pyx_v_value), __pyx_v_count, ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2750, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2751
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2752
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2752, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2751
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr>devPtr, <unsigned char>value, count, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2753
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2745
 *     return err
 * 
 * cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemsetAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2755
 *     return err
 * 
 * cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset2DAsync(void *__pyx_v_devPtr, size_t __pyx_v_pitch, int __pyx_v_value, size_t __pyx_v_width, size_t __pyx_v_height, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemset2DAsync", __pyx_f[0], 2755, 1, __PYX_ERR(0, 2755, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2756
 * 
 * cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2757
 * cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2757, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2758
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2759
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2758
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2760
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8Async(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_pitch, ((unsigned char)__pyx_v_value), __pyx_v_width, __pyx_v_height, ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2760, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2761
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2762
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2762, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2761
 *         return err
 *     err = <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr>devPtr, pitch, <unsigned char>value, width, height, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2763
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2755
 *     return err
 * 
 * cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemset2DAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2765
 *     return err
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPrefetchAsync(void const *__pyx_v_devPtr, size_t __pyx_v_count, int __pyx_v_dstDevice, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPrefetchAsync", __pyx_f[0], 2765, 1, __PYX_ERR(0, 2765, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2766
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2767
 * cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2767, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2768
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2769
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2768
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2770
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, ((CUdevice)__pyx_v_dstDevice), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2770, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2771
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2772
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2772, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2771
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync(<ccuda.CUdeviceptr>devPtr, count, <ccuda.CUdevice>dstDevice, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2773
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2765
 *     return err
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPrefetchAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2775
 *     return err
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPrefetchAsync_v2(void const *__pyx_v_devPtr, size_t __pyx_v_count, struct cudaMemLocation __pyx_v_location, unsigned int __pyx_v_flags, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  CUmemLocation __pyx_v__driver_location;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPrefetchAsync_v2", __pyx_f[0], 2775, 1, __PYX_ERR(0, 2775, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2776
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUmemLocation _driver_location
 *     err = m_global.lazyInitContextState()
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2778
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2778, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2779
 *     cdef ccuda.CUmemLocation _driver_location
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2780
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 *     _driver_location.id = location.id
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2779
 *     cdef ccuda.CUmemLocation _driver_location
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2781
 *     if err != cudaSuccess:
 *         return err
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type             # <<<<<<<<<<<<<<
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)
 */
  __pyx_v__driver_location.type = ((CUmemLocationType)__pyx_v_location.type);

  /* "cuda/_lib/ccudart/ccudart.pyx":2782
 *         return err
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 *     _driver_location.id = location.id             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
  __pyx_t_3 = __pyx_v_location.id;
  __pyx_v__driver_location.id = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":2783
 *     _driver_location.type = <ccuda.CUmemLocationType>location.type
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync_v2(((CUdeviceptr)__pyx_v_devPtr), __pyx_v_count, __pyx_v__driver_location, __pyx_v_flags, ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2783, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_4);

  /* "cuda/_lib/ccudart/ccudart.pyx":2784
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2785
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2785, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2784
 *     _driver_location.id = location.id
 *     err = <cudaError_t>ccuda._cuMemPrefetchAsync_v2(<ccuda.CUdeviceptr>devPtr, count, _driver_location, flags, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2786
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2775
 *     return err
 * 
 * cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUmemLocation _driver_location
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPrefetchAsync_v2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2788
 *     return err
 * 
 * cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocAsync(void **__pyx_v_devPtr, size_t __pyx_v_size, cudaStream_t __pyx_v_hStream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMallocAsync", __pyx_f[0], 2788, 1, __PYX_ERR(0, 2788, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2789
 * 
 * cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2790
 * cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2790, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2791
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2792
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2791
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2793
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocAsync(((CUdeviceptr *)__pyx_v_devPtr), __pyx_v_size, ((CUstream)__pyx_v_hStream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2793, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2794
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2795
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2795, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2794
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocAsync(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2796
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2788
 *     return err
 * 
 * cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2798
 *     return err
 * 
 * cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeAsync(void *__pyx_v_devPtr, cudaStream_t __pyx_v_hStream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaFreeAsync", __pyx_f[0], 2798, 1, __PYX_ERR(0, 2798, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2799
 * 
 * cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2800
 * cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2800, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2801
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2802
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2801
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2803
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeAsync(((CUdeviceptr)__pyx_v_devPtr), ((CUstream)__pyx_v_hStream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2803, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2804
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2805
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2805, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2804
 *         return err
 *     err = <cudaError_t>ccuda._cuMemFreeAsync(<ccuda.CUdeviceptr>devPtr, <ccuda.CUstream>hStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2806
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2798
 *     return err
 * 
 * cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaFreeAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2808
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolTrimTo(cudaMemPool_t __pyx_v_memPool, size_t __pyx_v_minBytesToKeep) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolTrimTo", __pyx_f[0], 2808, 1, __PYX_ERR(0, 2808, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2809
 * 
 * cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2810
 * cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2810, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2811
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2812
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2811
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2813
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolTrimTo(((CUmemoryPool)__pyx_v_memPool), __pyx_v_minBytesToKeep); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2813, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2814
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2815
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2815, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2814
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolTrimTo(<ccuda.CUmemoryPool>memPool, minBytesToKeep)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2816
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2808
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolTrimTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2818
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAttribute(cudaMemPool_t __pyx_v_memPool, enum cudaMemPoolAttr __pyx_v_attr, void *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolSetAttribute", __pyx_f[0], 2818, 1, __PYX_ERR(0, 2818, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2819
 * 
 * cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2820
 * cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2820, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2821
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2822
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2821
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2823
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAttribute(((CUmemoryPool)__pyx_v_memPool), ((CUmemPool_attribute)__pyx_v_attr), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2823, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2824
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2825
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2825, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2824
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolSetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2826
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2818
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2828
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolGetAttribute(cudaMemPool_t __pyx_v_memPool, enum cudaMemPoolAttr __pyx_v_attr, void *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolGetAttribute", __pyx_f[0], 2828, 1, __PYX_ERR(0, 2828, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2829
 * 
 * cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2830
 * cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2830, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2831
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2832
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2831
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2833
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAttribute(((CUmemoryPool)__pyx_v_memPool), ((CUmemPool_attribute)__pyx_v_attr), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2833, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2834
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2835
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2835, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2834
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAttribute(<ccuda.CUmemoryPool>memPool, <ccuda.CUmemPool_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2836
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2828
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolGetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2838
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolGetAccess(enum cudaMemAccessFlags *__pyx_v_flags, cudaMemPool_t __pyx_v_memPool, struct cudaMemLocation *__pyx_v_location) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolGetAccess", __pyx_f[0], 2838, 1, __PYX_ERR(0, 2838, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2839
 * 
 * cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2840
 * cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2840, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2841
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2842
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2841
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2843
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAccess(((CUmemAccess_flags *)__pyx_v_flags), ((CUmemoryPool)__pyx_v_memPool), ((CUmemLocation *)__pyx_v_location)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2843, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2844
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2845
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2845, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2844
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolGetAccess(<ccuda.CUmemAccess_flags*>flags, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemLocation*>location)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2846
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2838
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolGetAccess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2848
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolCreate(cudaMemPool_t *__pyx_v_memPool, struct cudaMemPoolProps const *__pyx_v_poolProps) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolCreate", __pyx_f[0], 2848, 1, __PYX_ERR(0, 2848, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2849
 * 
 * cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2850
 * cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2850, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2851
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2852
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2851
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2853
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolCreate(((CUmemoryPool *)__pyx_v_memPool), ((CUmemPoolProps *)__pyx_v_poolProps)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2853, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2854
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2855
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2855, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2854
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolCreate(<ccuda.CUmemoryPool*>memPool, <ccuda.CUmemPoolProps*>poolProps)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2856
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2848
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolCreate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2858
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolDestroy(cudaMemPool_t __pyx_v_memPool) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolDestroy", __pyx_f[0], 2858, 1, __PYX_ERR(0, 2858, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2859
 * 
 * cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2860
 * cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2860, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2861
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2862
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2861
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2863
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolDestroy(((CUmemoryPool)__pyx_v_memPool)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2863, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2864
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2865
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2865, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2864
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolDestroy(<ccuda.CUmemoryPool>memPool)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2866
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2858
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2868
 *     return err
 * 
 * cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocFromPoolAsync(void **__pyx_v_ptr, size_t __pyx_v_size, cudaMemPool_t __pyx_v_memPool, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMallocFromPoolAsync", __pyx_f[0], 2868, 1, __PYX_ERR(0, 2868, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2869
 * 
 * cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2870
 * cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2870, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2871
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2872
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2871
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2873
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocFromPoolAsync(((CUdeviceptr *)__pyx_v_ptr), __pyx_v_size, ((CUmemoryPool)__pyx_v_memPool), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2873, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2874
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2875
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2875, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2874
 *         return err
 *     err = <cudaError_t>ccuda._cuMemAllocFromPoolAsync(<ccuda.CUdeviceptr*>ptr, size, <ccuda.CUmemoryPool>memPool, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2876
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2868
 *     return err
 * 
 * cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMallocFromPoolAsync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2878
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolExportToShareableHandle(void *__pyx_v_shareableHandle, cudaMemPool_t __pyx_v_memPool, enum cudaMemAllocationHandleType __pyx_v_handleType, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolExportToShareableHandle", __pyx_f[0], 2878, 1, __PYX_ERR(0, 2878, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2879
 * 
 * cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2880
 * cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2880, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2881
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2882
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2881
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2883
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportToShareableHandle(__pyx_v_shareableHandle, ((CUmemoryPool)__pyx_v_memPool), ((CUmemAllocationHandleType)__pyx_v_handleType), ((unsigned PY_LONG_LONG)__pyx_v_flags)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2883, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2884
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2885
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2885, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2884
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportToShareableHandle(shareableHandle, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2886
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2878
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolExportToShareableHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2888
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolImportFromShareableHandle(cudaMemPool_t *__pyx_v_memPool, void *__pyx_v_shareableHandle, enum cudaMemAllocationHandleType __pyx_v_handleType, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolImportFromShareableHandle", __pyx_f[0], 2888, 1, __PYX_ERR(0, 2888, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2889
 * 
 * cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2890
 * cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2890, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2891
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2892
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2891
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2893
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportFromShareableHandle(((CUmemoryPool *)__pyx_v_memPool), __pyx_v_shareableHandle, ((CUmemAllocationHandleType)__pyx_v_handleType), ((unsigned PY_LONG_LONG)__pyx_v_flags)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2893, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2894
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2895
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2895, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2894
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportFromShareableHandle(<ccuda.CUmemoryPool*>memPool, shareableHandle, <ccuda.CUmemAllocationHandleType>handleType, <unsigned long long>flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2896
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2888
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolImportFromShareableHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2898
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *__pyx_v_exportData, void *__pyx_v_ptr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolExportPointer", __pyx_f[0], 2898, 1, __PYX_ERR(0, 2898, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2899
 * 
 * cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2900
 * cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2900, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2901
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2902
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2901
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2903
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportPointer(((CUmemPoolPtrExportData *)__pyx_v_exportData), ((CUdeviceptr)__pyx_v_ptr)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2903, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2904
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2905
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2905, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2904
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolExportPointer(<ccuda.CUmemPoolPtrExportData*>exportData, <ccuda.CUdeviceptr>ptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2906
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2898
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolExportPointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2908
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolImportPointer(void **__pyx_v_ptr, cudaMemPool_t __pyx_v_memPool, struct cudaMemPoolPtrExportData *__pyx_v_exportData) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaMemPoolImportPointer", __pyx_f[0], 2908, 1, __PYX_ERR(0, 2908, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2909
 * 
 * cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2910
 * cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2910, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2911
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2912
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2911
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2913
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportPointer(((CUdeviceptr *)__pyx_v_ptr), ((CUmemoryPool)__pyx_v_memPool), ((CUmemPoolPtrExportData *)__pyx_v_exportData)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2913, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2914
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2915
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2915, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2914
 *         return err
 *     err = <cudaError_t>ccuda._cuMemPoolImportPointer(<ccuda.CUdeviceptr*>ptr, <ccuda.CUmemoryPool>memPool, <ccuda.CUmemPoolPtrExportData*>exportData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2916
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2908
 *     return err
 * 
 * cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaMemPoolImportPointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2918
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsUnregisterResource(cudaGraphicsResource_t __pyx_v_resource) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsUnregisterResource", __pyx_f[0], 2918, 1, __PYX_ERR(0, 2918, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2919
 * 
 * cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2920
 * cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2920, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2921
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2922
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2921
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2923
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnregisterResource(((CUgraphicsResource)__pyx_v_resource)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2923, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2924
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2925
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2925, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2924
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnregisterResource(<ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2926
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2918
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsUnregisterResource", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2928
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t __pyx_v_resource, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsResourceSetMapFlags", __pyx_f[0], 2928, 1, __PYX_ERR(0, 2928, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2929
 * 
 * cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2930
 * cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2930, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2931
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2932
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2931
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2933
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceSetMapFlags_v2(((CUgraphicsResource)__pyx_v_resource), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2933, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2934
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2935
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2935, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2934
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceSetMapFlags_v2(<ccuda.CUgraphicsResource>resource, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2936
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2928
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsResourceSetMapFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2938
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsMapResources(int __pyx_v_count, cudaGraphicsResource_t *__pyx_v_resources, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsMapResources", __pyx_f[0], 2938, 1, __PYX_ERR(0, 2938, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2939
 * 
 * cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2940
 * cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2940, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2941
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2942
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2941
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2943
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsMapResources(((unsigned int)__pyx_v_count), ((CUgraphicsResource *)__pyx_v_resources), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2943, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2944
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2945
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2945, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2944
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsMapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2946
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2938
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsMapResources", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2948
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsUnmapResources(int __pyx_v_count, cudaGraphicsResource_t *__pyx_v_resources, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsUnmapResources", __pyx_f[0], 2948, 1, __PYX_ERR(0, 2948, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2949
 * 
 * cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2950
 * cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2950, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2951
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2952
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2951
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2953
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnmapResources(((unsigned int)__pyx_v_count), ((CUgraphicsResource *)__pyx_v_resources), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2953, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2954
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2955
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2955, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2954
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsUnmapResources(<unsigned int>count, <ccuda.CUgraphicsResource*>resources, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2956
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2948
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsUnmapResources", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2958
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedPointer(void **__pyx_v_devPtr, size_t *__pyx_v_size, cudaGraphicsResource_t __pyx_v_resource) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsResourceGetMappedPointer", __pyx_f[0], 2958, 1, __PYX_ERR(0, 2958, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2959
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2960
 * cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2960, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2961
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2962
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2961
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2963
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedPointer_v2(((CUdeviceptr *)__pyx_v_devPtr), __pyx_v_size, ((CUgraphicsResource)__pyx_v_resource)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2963, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2964
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2965
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2965, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2964
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedPointer_v2(<ccuda.CUdeviceptr*>devPtr, size, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2966
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2958
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsResourceGetMappedPointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2968
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsSubResourceGetMappedArray(cudaArray_t *__pyx_v_array, cudaGraphicsResource_t __pyx_v_resource, unsigned int __pyx_v_arrayIndex, unsigned int __pyx_v_mipLevel) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsSubResourceGetMappedArray", __pyx_f[0], 2968, 1, __PYX_ERR(0, 2968, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2969
 * 
 * cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2970
 * cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2970, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2971
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2972
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2971
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2973
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsSubResourceGetMappedArray(((CUarray *)__pyx_v_array), ((CUgraphicsResource)__pyx_v_resource), __pyx_v_arrayIndex, __pyx_v_mipLevel); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2973, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2974
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2975
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2975, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2974
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsSubResourceGetMappedArray(<ccuda.CUarray*>array, <ccuda.CUgraphicsResource>resource, arrayIndex, mipLevel)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2976
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2968
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsSubResourceGetMappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2978
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmappedArray, cudaGraphicsResource_t __pyx_v_resource) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsResourceGetMappedMipmappedArray", __pyx_f[0], 2978, 1, __PYX_ERR(0, 2978, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2979
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2980
 * cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2980, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2981
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2982
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2981
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2983
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedMipmappedArray(((CUmipmappedArray *)__pyx_v_mipmappedArray), ((CUgraphicsResource)__pyx_v_resource)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2983, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2984
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2985
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2985, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2984
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsResourceGetMappedMipmappedArray(<ccuda.CUmipmappedArray*>mipmappedArray, <ccuda.CUgraphicsResource>resource)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2986
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2978
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsResourceGetMappedMipmappedArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2988
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyTextureObject(cudaTextureObject_t __pyx_v_texObject) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDestroyTextureObject", __pyx_f[0], 2988, 1, __PYX_ERR(0, 2988, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2989
 * 
 * cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":2990
 * cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2990, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":2991
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2992
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":2991
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2993
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectDestroy(((CUtexObject)__pyx_v_texObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2993, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":2994
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":2995
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2995, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":2994
 *         return err
 *     err = <cudaError_t>ccuda._cuTexObjectDestroy(<ccuda.CUtexObject>texObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":2996
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2988
 *     return err
 * 
 * cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDestroyTextureObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":2998
 *     return err
 * 
 * cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroySurfaceObject(cudaSurfaceObject_t __pyx_v_surfObject) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDestroySurfaceObject", __pyx_f[0], 2998, 1, __PYX_ERR(0, 2998, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":2999
 * 
 * cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3000
 * cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3000, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3001
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3002
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3001
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3003
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectDestroy(((CUsurfObject)__pyx_v_surfObject)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3003, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3004
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3005
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3005, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3004
 *         return err
 *     err = <cudaError_t>ccuda._cuSurfObjectDestroy(<ccuda.CUsurfObject>surfObject)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3006
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":2998
 *     return err
 * 
 * cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDestroySurfaceObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3008
 *     return err
 * 
 * cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphCreate(cudaGraph_t *__pyx_v_pGraph, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphCreate", __pyx_f[0], 3008, 1, __PYX_ERR(0, 3008, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3009
 * 
 * cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3010
 * cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3010, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3011
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3012
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3011
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3013
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphCreate(((CUgraph *)__pyx_v_pGraph), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3013, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3014
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3015
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3015, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3014
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphCreate(<ccuda.CUgraph*>pGraph, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3016
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3008
 *     return err
 * 
 * cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphCreate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3018
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddKernelNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaKernelNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_KERNEL_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddKernelNode", __pyx_f[0], 3018, 1, __PYX_ERR(0, 3018, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3019
 * 
 * cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3020
 * cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3020, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3021
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3022
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3021
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3024
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3024, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3025
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3026
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3025
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3027
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddKernelNode_v2(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3027, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3028
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3029
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3029, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3028
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddKernelNode_v2(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3030
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3018
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddKernelNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3032
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetParams(cudaGraphNode_t __pyx_v_node, struct cudaKernelNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_KERNEL_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphKernelNodeSetParams", __pyx_f[0], 3032, 1, __PYX_ERR(0, 3032, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3033
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3034
 * cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3034, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3035
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3036
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3035
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3038
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3038, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3039
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3040
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3039
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3041
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetParams_v2(((CUgraphNode)__pyx_v_node), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3041, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3042
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3043
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3043, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3042
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeSetParams_v2(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3044
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3032
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3046
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t __pyx_v_hSrc, cudaGraphNode_t __pyx_v_hDst) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphKernelNodeCopyAttributes", __pyx_f[0], 3046, 1, __PYX_ERR(0, 3046, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3047
 * 
 * cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3048
 * cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3048, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3049
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3050
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3049
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3051
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeCopyAttributes(((CUgraphNode)__pyx_v_hSrc), ((CUgraphNode)__pyx_v_hDst)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3051, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3052
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3053
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3053, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3052
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphKernelNodeCopyAttributes(<ccuda.CUgraphNode>hSrc, <ccuda.CUgraphNode>hDst)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3054
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3046
 *     return err
 * 
 * cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphKernelNodeCopyAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3056
 *     return err
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemsetNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemsetParams *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphMemsetNodeGetParams", __pyx_f[0], 3056, 1, __PYX_ERR(0, 3056, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3057
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3058
 * cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3058, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3059
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3060
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3059
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3061
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeGetParams(((CUgraphNode)__pyx_v_node), ((CUDA_MEMSET_NODE_PARAMS *)__pyx_v_pNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3061, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3062
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3063
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3063, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3062
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3064
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3056
 *     return err
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemsetNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3066
 *     return err
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemsetNodeSetParams(cudaGraphNode_t __pyx_v_node, struct cudaMemsetParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphMemsetNodeSetParams", __pyx_f[0], 3066, 1, __PYX_ERR(0, 3066, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3067
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3068
 * cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3068, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3069
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3070
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3069
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3071
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeSetParams(((CUgraphNode)__pyx_v_node), ((CUDA_MEMSET_NODE_PARAMS *)__pyx_v_pNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3071, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3072
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3073
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3073, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3072
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphMemsetNodeSetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_MEMSET_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3074
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3066
 *     return err
 * 
 * cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphMemsetNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3076
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddHostNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaHostNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_HOST_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddHostNode", __pyx_f[0], 3076, 1, __PYX_ERR(0, 3076, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3077
 * 
 * cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3078
 * cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3078, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3079
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3080
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3079
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3082
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddHostNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3082, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3083
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphAddHostNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddHostNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3083, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3084
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphAddHostNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3085
 *     err = <cudaError_t>ccuda._cuGraphAddHostNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3085, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3084
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphAddHostNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3086
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3076
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddHostNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3088
 *     return err
 * 
 * cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphHostNodeGetParams(cudaGraphNode_t __pyx_v_node, struct cudaHostNodeParams *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphHostNodeGetParams", __pyx_f[0], 3088, 1, __PYX_ERR(0, 3088, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3089
 * 
 * cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3090
 * cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3090, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3091
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3092
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3091
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3093
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeGetParams(((CUgraphNode)__pyx_v_node), ((CUDA_HOST_NODE_PARAMS *)__pyx_v_pNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3093, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3094
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3095
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3095, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3094
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphHostNodeGetParams(<ccuda.CUgraphNode>node, <ccuda.CUDA_HOST_NODE_PARAMS*>pNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3096
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3088
 *     return err
 * 
 * cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphHostNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3098
 *     return err
 * 
 * cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphHostNodeSetParams(cudaGraphNode_t __pyx_v_node, struct cudaHostNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_HOST_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphHostNodeSetParams", __pyx_f[0], 3098, 1, __PYX_ERR(0, 3098, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3099
 * 
 * cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3100
 * cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3100, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3101
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3102
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3101
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3104
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphHostNodeSetParams(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3104, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3105
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphHostNodeSetParams(<ccuda.CUgraphNode>node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeSetParams(((CUgraphNode)__pyx_v_node), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3105, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3106
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphHostNodeSetParams(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3107
 *     err = <cudaError_t>ccuda._cuGraphHostNodeSetParams(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3107, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3106
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphHostNodeSetParams(<ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3108
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3098
 *     return err
 * 
 * cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphHostNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3110
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddChildGraphNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, cudaGraph_t __pyx_v_childGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddChildGraphNode", __pyx_f[0], 3110, 1, __PYX_ERR(0, 3110, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3111
 * 
 * cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3112
 * cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3112, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3113
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3114
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3113
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3115
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddChildGraphNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUgraph)__pyx_v_childGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3115, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3116
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3117
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3117, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3116
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddChildGraphNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3118
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3110
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddChildGraphNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3120
 *     return err
 * 
 * cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t __pyx_v_node, cudaGraph_t *__pyx_v_pGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphChildGraphNodeGetGraph", __pyx_f[0], 3120, 1, __PYX_ERR(0, 3120, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3121
 * 
 * cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3122
 * cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3122, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3123
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3124
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3123
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3125
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphChildGraphNodeGetGraph(((CUgraphNode)__pyx_v_node), ((CUgraph *)__pyx_v_pGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3125, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3126
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3127
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3127, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3126
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphChildGraphNodeGetGraph(<ccuda.CUgraphNode>node, <ccuda.CUgraph*>pGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3128
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3120
 *     return err
 * 
 * cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphChildGraphNodeGetGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3130
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEmptyNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddEmptyNode", __pyx_f[0], 3130, 1, __PYX_ERR(0, 3130, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3131
 * 
 * cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3132
 * cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3132, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3133
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3134
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3133
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3135
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEmptyNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3135, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3136
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3137
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3137, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3136
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEmptyNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3138
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3130
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddEmptyNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3140
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEventRecordNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddEventRecordNode", __pyx_f[0], 3140, 1, __PYX_ERR(0, 3140, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3141
 * 
 * cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3142
 * cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3142, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3143
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3144
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3143
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3145
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventRecordNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3145, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3146
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3147
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3147, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3146
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventRecordNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3148
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3140
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddEventRecordNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3150
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t __pyx_v_node, cudaEvent_t *__pyx_v_event_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphEventRecordNodeGetEvent", __pyx_f[0], 3150, 1, __PYX_ERR(0, 3150, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3151
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3152
 * cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3152, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3153
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3154
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3153
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3155
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeGetEvent(((CUgraphNode)__pyx_v_node), ((CUevent *)__pyx_v_event_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3155, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3156
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3157
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3157, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3156
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3158
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3150
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphEventRecordNodeGetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3160
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t __pyx_v_node, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphEventRecordNodeSetEvent", __pyx_f[0], 3160, 1, __PYX_ERR(0, 3160, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3161
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3162
 * cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3162, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3163
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3164
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3163
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3165
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeSetEvent(((CUgraphNode)__pyx_v_node), ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3165, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3166
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3167
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3167, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3166
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventRecordNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3168
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3160
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphEventRecordNodeSetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3170
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEventWaitNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddEventWaitNode", __pyx_f[0], 3170, 1, __PYX_ERR(0, 3170, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3171
 * 
 * cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3172
 * cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3172, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3173
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3174
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3173
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3175
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventWaitNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3175, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3176
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3177
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3177, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3176
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddEventWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3178
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3170
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddEventWaitNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3180
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t __pyx_v_node, cudaEvent_t *__pyx_v_event_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphEventWaitNodeGetEvent", __pyx_f[0], 3180, 1, __PYX_ERR(0, 3180, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3181
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3182
 * cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3182, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3183
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3184
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3183
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3185
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeGetEvent(((CUgraphNode)__pyx_v_node), ((CUevent *)__pyx_v_event_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3185, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3186
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3187
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3187, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3186
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeGetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent*>event_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3188
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3180
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphEventWaitNodeGetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3190
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t __pyx_v_node, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphEventWaitNodeSetEvent", __pyx_f[0], 3190, 1, __PYX_ERR(0, 3190, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3191
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3192
 * cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3192, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3193
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3194
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3193
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3195
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeSetEvent(((CUgraphNode)__pyx_v_node), ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3195, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3196
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3197
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3197, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3196
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphEventWaitNodeSetEvent(<ccuda.CUgraphNode>node, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3198
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3190
 *     return err
 * 
 * cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphEventWaitNodeSetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3200
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaExternalSemaphoreSignalNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddExternalSemaphoresSignalNode", __pyx_f[0], 3200, 1, __PYX_ERR(0, 3200, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3201
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3202
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3202, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3203
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3204
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3203
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3205
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresSignalNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3205, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3206
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3207
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3207, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3206
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresSignalNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3208
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3200
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddExternalSemaphoresSignalNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3210
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreSignalNodeParams *__pyx_v_params_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExternalSemaphoresSignalNodeGetParams", __pyx_f[0], 3210, 1, __PYX_ERR(0, 3210, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3211
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3212
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3212, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3213
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3214
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3213
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3215
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeGetParams(((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *)__pyx_v_params_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3215, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3216
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3217
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3217, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3216
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3218
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3210
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExternalSemaphoresSignalNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3220
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreSignalNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExternalSemaphoresSignalNodeSetParams", __pyx_f[0], 3220, 1, __PYX_ERR(0, 3220, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3221
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3222
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3222, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3223
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3224
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3223
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3225
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeSetParams(((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3225, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3226
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3227
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3227, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3226
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3228
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3220
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExternalSemaphoresSignalNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3230
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaExternalSemaphoreWaitNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddExternalSemaphoresWaitNode", __pyx_f[0], 3230, 1, __PYX_ERR(0, 3230, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3231
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3232
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3232, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3233
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3234
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3233
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3235
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresWaitNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUDA_EXT_SEM_WAIT_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3235, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3236
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3237
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3237, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3236
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddExternalSemaphoresWaitNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3238
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3230
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddExternalSemaphoresWaitNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3240
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreWaitNodeParams *__pyx_v_params_out) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExternalSemaphoresWaitNodeGetParams", __pyx_f[0], 3240, 1, __PYX_ERR(0, 3240, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3241
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3242
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3242, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3243
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3244
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3243
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3245
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeGetParams(((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_WAIT_NODE_PARAMS *)__pyx_v_params_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3245, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3246
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3247
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3247, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3246
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeGetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>params_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3248
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3240
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExternalSemaphoresWaitNodeGetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3250
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreWaitNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExternalSemaphoresWaitNodeSetParams", __pyx_f[0], 3250, 1, __PYX_ERR(0, 3250, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3251
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3252
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3252, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3253
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3254
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3253
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3255
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeSetParams(((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_WAIT_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3255, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3256
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3257
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3257, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3256
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3258
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3250
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExternalSemaphoresWaitNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3260
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemFreeNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, void *__pyx_v_dptr) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddMemFreeNode", __pyx_f[0], 3260, 1, __PYX_ERR(0, 3260, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3261
 * 
 * cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3262
 * cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3263
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3264
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3263
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3265
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemFreeNode(((CUgraphNode *)__pyx_v_pGraphNode), ((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_numDependencies, ((CUdeviceptr)__pyx_v_dptr)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3265, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3266
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3267
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3267, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3266
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddMemFreeNode(<ccuda.CUgraphNode*>pGraphNode, <ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pDependencies, numDependencies, <ccuda.CUdeviceptr>dptr)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3268
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3260
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddMemFreeNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3270
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGraphMemTrim(int __pyx_v_device) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGraphMemTrim", __pyx_f[0], 3270, 1, __PYX_ERR(0, 3270, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3271
 * 
 * cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3272
 * cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3272, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3273
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3274
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3273
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3275
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGraphMemTrim(((CUdevice)__pyx_v_device)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3275, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3276
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3277
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3277, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3276
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGraphMemTrim(<ccuda.CUdevice>device)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3278
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3270
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGraphMemTrim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3280
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetGraphMemAttribute(int __pyx_v_device, enum cudaGraphMemAttributeType __pyx_v_attr, void *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceGetGraphMemAttribute", __pyx_f[0], 3280, 1, __PYX_ERR(0, 3280, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3281
 * 
 * cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3282
 * cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3282, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3283
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3284
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3283
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3285
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetGraphMemAttribute(((CUdevice)__pyx_v_device), ((CUgraphMem_attribute)__pyx_v_attr), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3285, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3286
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3287
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3287, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3286
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceGetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3288
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3280
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceGetGraphMemAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3290
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetGraphMemAttribute(int __pyx_v_device, enum cudaGraphMemAttributeType __pyx_v_attr, void *__pyx_v_value) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaDeviceSetGraphMemAttribute", __pyx_f[0], 3290, 1, __PYX_ERR(0, 3290, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3291
 * 
 * cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3292
 * cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3292, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3293
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3294
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3293
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3295
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetGraphMemAttribute(((CUdevice)__pyx_v_device), ((CUgraphMem_attribute)__pyx_v_attr), __pyx_v_value); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3295, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3296
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3297
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3297, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3296
 *         return err
 *     err = <cudaError_t>ccuda._cuDeviceSetGraphMemAttribute(<ccuda.CUdevice>device, <ccuda.CUgraphMem_attribute>attr, value)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3298
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3290
 *     return err
 * 
 * cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaDeviceSetGraphMemAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3300
 *     return err
 * 
 * cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphClone(cudaGraph_t *__pyx_v_pGraphClone, cudaGraph_t __pyx_v_originalGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphClone", __pyx_f[0], 3300, 1, __PYX_ERR(0, 3300, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3301
 * 
 * cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3302
 * cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3302, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3303
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3304
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3303
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3305
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphClone(((CUgraph *)__pyx_v_pGraphClone), ((CUgraph)__pyx_v_originalGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3305, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3306
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3307
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3307, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3306
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphClone(<ccuda.CUgraph*>pGraphClone, <ccuda.CUgraph>originalGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3308
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3300
 *     return err
 * 
 * cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphClone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3310
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeFindInClone(cudaGraphNode_t *__pyx_v_pNode, cudaGraphNode_t __pyx_v_originalNode, cudaGraph_t __pyx_v_clonedGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeFindInClone", __pyx_f[0], 3310, 1, __PYX_ERR(0, 3310, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3311
 * 
 * cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3312
 * cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3312, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3313
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3314
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3313
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3315
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeFindInClone(((CUgraphNode *)__pyx_v_pNode), ((CUgraphNode)__pyx_v_originalNode), ((CUgraph)__pyx_v_clonedGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3315, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3316
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3317
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3317, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3316
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeFindInClone(<ccuda.CUgraphNode*>pNode, <ccuda.CUgraphNode>originalNode, <ccuda.CUgraph>clonedGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3318
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3310
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeFindInClone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3320
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetType(cudaGraphNode_t __pyx_v_node, enum cudaGraphNodeType *__pyx_v_pType) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeGetType", __pyx_f[0], 3320, 1, __PYX_ERR(0, 3320, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3321
 * 
 * cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3322
 * cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3322, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3323
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3324
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3323
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3325
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetType(((CUgraphNode)__pyx_v_node), ((CUgraphNodeType *)__pyx_v_pType)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3325, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3326
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3327
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3327, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3326
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetType(<ccuda.CUgraphNode>node, <ccuda.CUgraphNodeType*>pType)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3328
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3320
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeGetType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3330
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetNodes(cudaGraph_t __pyx_v_graph, cudaGraphNode_t *__pyx_v_nodes, size_t *__pyx_v_numNodes) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphGetNodes", __pyx_f[0], 3330, 1, __PYX_ERR(0, 3330, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3331
 * 
 * cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3332
 * cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3332, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3333
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3334
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3333
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3335
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetNodes(((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_nodes), __pyx_v_numNodes); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3335, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3336
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3337
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3337, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3336
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>nodes, numNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3338
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3330
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphGetNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3340
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetRootNodes(cudaGraph_t __pyx_v_graph, cudaGraphNode_t *__pyx_v_pRootNodes, size_t *__pyx_v_pNumRootNodes) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphGetRootNodes", __pyx_f[0], 3340, 1, __PYX_ERR(0, 3340, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3341
 * 
 * cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3342
 * cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3342, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3343
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3344
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3343
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3345
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetRootNodes(((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_pRootNodes), __pyx_v_pNumRootNodes); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3345, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3346
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3347
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3347, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3346
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetRootNodes(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>pRootNodes, pNumRootNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3348
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3340
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphGetRootNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3350
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetEdges(cudaGraph_t __pyx_v_graph, cudaGraphNode_t *__pyx_v_from_, cudaGraphNode_t *__pyx_v_to, size_t *__pyx_v_numEdges) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphGetEdges", __pyx_f[0], 3350, 1, __PYX_ERR(0, 3350, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3351
 * 
 * cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3352
 * cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3352, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3353
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3354
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3353
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3355
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetEdges(((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_from_), ((CUgraphNode *)__pyx_v_to), __pyx_v_numEdges); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3355, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3356
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3357
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3357, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3356
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphGetEdges(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numEdges)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3358
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3350
 *     return err
 * 
 * cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphGetEdges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3360
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetDependencies(cudaGraphNode_t __pyx_v_node, cudaGraphNode_t *__pyx_v_pDependencies, size_t *__pyx_v_pNumDependencies) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeGetDependencies", __pyx_f[0], 3360, 1, __PYX_ERR(0, 3360, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3361
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3362
 * cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3362, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3363
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3364
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3363
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3365
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependencies(((CUgraphNode)__pyx_v_node), ((CUgraphNode *)__pyx_v_pDependencies), __pyx_v_pNumDependencies); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3365, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3366
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3367
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3367, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3366
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependencies(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependencies, pNumDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3368
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3360
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeGetDependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3370
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetDependentNodes(cudaGraphNode_t __pyx_v_node, cudaGraphNode_t *__pyx_v_pDependentNodes, size_t *__pyx_v_pNumDependentNodes) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeGetDependentNodes", __pyx_f[0], 3370, 1, __PYX_ERR(0, 3370, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3371
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3372
 * cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3372, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3373
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3374
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3373
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3375
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependentNodes(((CUgraphNode)__pyx_v_node), ((CUgraphNode *)__pyx_v_pDependentNodes), __pyx_v_pNumDependentNodes); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3375, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3376
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3377
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3377, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3376
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetDependentNodes(<ccuda.CUgraphNode>node, <ccuda.CUgraphNode*>pDependentNodes, pNumDependentNodes)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3378
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3370
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeGetDependentNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3380
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddDependencies(cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_from_, cudaGraphNode_t const *__pyx_v_to, size_t __pyx_v_numDependencies) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddDependencies", __pyx_f[0], 3380, 1, __PYX_ERR(0, 3380, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3381
 * 
 * cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3382
 * cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3382, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3383
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3384
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3383
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3385
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddDependencies(((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_from_), ((CUgraphNode *)__pyx_v_to), __pyx_v_numDependencies); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3385, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3386
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3387
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3387, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3386
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3388
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3380
 *     return err
 * 
 * cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddDependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3390
 *     return err
 * 
 * cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphRemoveDependencies(cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_from_, cudaGraphNode_t const *__pyx_v_to, size_t __pyx_v_numDependencies) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphRemoveDependencies", __pyx_f[0], 3390, 1, __PYX_ERR(0, 3390, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3391
 * 
 * cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3392
 * cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3392, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3393
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3394
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3393
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3395
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphRemoveDependencies(((CUgraph)__pyx_v_graph), ((CUgraphNode *)__pyx_v_from_), ((CUgraphNode *)__pyx_v_to), __pyx_v_numDependencies); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3395, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3396
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3397
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3397, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3396
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRemoveDependencies(<ccuda.CUgraph>graph, <ccuda.CUgraphNode*>from_, <ccuda.CUgraphNode*>to, numDependencies)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3398
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3390
 *     return err
 * 
 * cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphRemoveDependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3400
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDestroyNode(cudaGraphNode_t __pyx_v_node) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphDestroyNode", __pyx_f[0], 3400, 1, __PYX_ERR(0, 3400, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3401
 * 
 * cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3402
 * cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3402, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3403
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3404
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3403
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3405
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroyNode(((CUgraphNode)__pyx_v_node)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3405, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3406
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3407
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3407, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3406
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroyNode(<ccuda.CUgraphNode>node)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3408
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3400
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphDestroyNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3410
 *     return err
 * 
 * cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return _cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiate(cudaGraphExec_t *__pyx_v_pGraphExec, cudaGraph_t __pyx_v_graph, unsigned PY_LONG_LONG __pyx_v_flags) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphInstantiate", __pyx_f[0], 3410, 1, __PYX_ERR(0, 3410, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3411
 * 
 * cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     return _cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithFlags(__pyx_v_pGraphExec, __pyx_v_graph, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3411, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3410
 *     return err
 * 
 * cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return _cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphInstantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3413
 *     return _cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithFlags(cudaGraphExec_t *__pyx_v_pGraphExec, cudaGraph_t __pyx_v_graph, unsigned PY_LONG_LONG __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphInstantiateWithFlags", __pyx_f[0], 3413, 1, __PYX_ERR(0, 3413, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3414
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3415
 * cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3415, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3416
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3417
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3416
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3418
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithFlags(((CUgraphExec *)__pyx_v_pGraphExec), ((CUgraph)__pyx_v_graph), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3418, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3419
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3420
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3420, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3419
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithFlags(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3421
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3413
 *     return _cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphInstantiateWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3423
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecKernelNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, struct cudaKernelNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_KERNEL_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecKernelNodeSetParams", __pyx_f[0], 3423, 1, __PYX_ERR(0, 3423, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3424
 * 
 * cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3425
 * cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3425, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3426
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3427
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3426
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3429
 *         return err
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3429, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3430
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3431
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3430
 *     cdef ccuda.CUDA_KERNEL_NODE_PARAMS driverNodeParams
 *     err = toDriverKernelNodeParams(pNodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3432
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecKernelNodeSetParams_v2(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_node), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3432, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3433
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3434
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3434, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3433
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecKernelNodeSetParams_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3435
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3423
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecKernelNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3437
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecHostNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, struct cudaHostNodeParams const *__pyx_v_pNodeParams) {
  cudaError_t __pyx_v_err;
  CUDA_HOST_NODE_PARAMS __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecHostNodeSetParams", __pyx_f[0], 3437, 1, __PYX_ERR(0, 3437, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3438
 * 
 * cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3439
 * cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3439, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3440
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3441
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3440
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3443
 *         return err
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecHostNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams(__pyx_v_pNodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3443, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3444
 *     cdef ccuda.CUDA_HOST_NODE_PARAMS driverNodeParams
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphExecHostNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecHostNodeSetParams(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_node), (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3444, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3445
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphExecHostNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3446
 *     err = <cudaError_t>ccuda._cuGraphExecHostNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3446, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3445
 *     toDriverHostNodeParams(pNodeParams, &driverNodeParams)
 *     err = <cudaError_t>ccuda._cuGraphExecHostNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3447
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3437
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecHostNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3449
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_node, cudaGraph_t __pyx_v_childGraph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecChildGraphNodeSetParams", __pyx_f[0], 3449, 1, __PYX_ERR(0, 3449, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3450
 * 
 * cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3451
 * cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3451, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3452
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3453
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3452
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3454
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecChildGraphNodeSetParams(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_node), ((CUgraph)__pyx_v_childGraph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3454, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3455
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3456
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3456, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3455
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecChildGraphNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>node, <ccuda.CUgraph>childGraph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3457
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3449
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecChildGraphNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3459
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecEventRecordNodeSetEvent", __pyx_f[0], 3459, 1, __PYX_ERR(0, 3459, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3460
 * 
 * cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3461
 * cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3461, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3462
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3463
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3462
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3464
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventRecordNodeSetEvent(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3464, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3465
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3466
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3466, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3465
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventRecordNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3467
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3459
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecEventRecordNodeSetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3469
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, cudaEvent_t __pyx_v_event) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecEventWaitNodeSetEvent", __pyx_f[0], 3469, 1, __PYX_ERR(0, 3469, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3470
 * 
 * cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3471
 * cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3471, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3472
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3473
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3472
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3474
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventWaitNodeSetEvent(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), ((CUevent)__pyx_v_event)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3474, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3475
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3476
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3476, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3475
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecEventWaitNodeSetEvent(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUevent>event)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3477
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3469
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecEventWaitNodeSetEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3479
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreSignalNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecExternalSemaphoresSignalNodeSetParams", __pyx_f[0], 3479, 1, __PYX_ERR(0, 3479, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3480
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3481
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3481, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3482
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3483
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3482
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3484
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresSignalNodeSetParams(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3484, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3485
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3486
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3486, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3485
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresSignalNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3487
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3479
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecExternalSemaphoresSignalNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3489
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, struct cudaExternalSemaphoreWaitNodeParams const *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecExternalSemaphoresWaitNodeSetParams", __pyx_f[0], 3489, 1, __PYX_ERR(0, 3489, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3490
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3491
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3491, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3492
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3493
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3492
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3494
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresWaitNodeSetParams(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), ((CUDA_EXT_SEM_WAIT_NODE_PARAMS *)__pyx_v_nodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3494, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3495
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3496
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3496, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3495
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecExternalSemaphoresWaitNodeSetParams(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, <ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS*>nodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3497
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3489
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecExternalSemaphoresWaitNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3499
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeSetEnabled(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, unsigned int __pyx_v_isEnabled) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeSetEnabled", __pyx_f[0], 3499, 1, __PYX_ERR(0, 3499, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3500
 * 
 * cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3501
 * cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3501, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3502
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3503
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3502
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3504
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetEnabled(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), __pyx_v_isEnabled); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3504, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3505
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3506
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3506, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3505
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3507
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3499
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeSetEnabled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3509
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetEnabled(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraphNode_t __pyx_v_hNode, unsigned int *__pyx_v_isEnabled) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeGetEnabled", __pyx_f[0], 3509, 1, __PYX_ERR(0, 3509, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3510
 * 
 * cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3511
 * cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3511, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3512
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3513
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3512
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3514
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetEnabled(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraphNode)__pyx_v_hNode), __pyx_v_isEnabled); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3514, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3515
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3516
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3516, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3515
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeGetEnabled(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraphNode>hNode, isEnabled)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3517
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3509
 *     return err
 * 
 * cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeGetEnabled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3519
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecUpdate(cudaGraphExec_t __pyx_v_hGraphExec, cudaGraph_t __pyx_v_hGraph, cudaGraphExecUpdateResultInfo *__pyx_v_resultInfo) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecUpdate", __pyx_f[0], 3519, 1, __PYX_ERR(0, 3519, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3520
 * 
 * cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3521
 * cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3521, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3522
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3523
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3522
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3524
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecUpdate_v2(((CUgraphExec)__pyx_v_hGraphExec), ((CUgraph)__pyx_v_hGraph), ((CUgraphExecUpdateResultInfo *)__pyx_v_resultInfo)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3524, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3525
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3526
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3526, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3525
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecUpdate_v2(<ccuda.CUgraphExec>hGraphExec, <ccuda.CUgraph>hGraph, <ccuda.CUgraphExecUpdateResultInfo*>resultInfo)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3527
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3519
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3529
 *     return err
 * 
 * cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphUpload(cudaGraphExec_t __pyx_v_graphExec, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphUpload", __pyx_f[0], 3529, 1, __PYX_ERR(0, 3529, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3530
 * 
 * cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3531
 * cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3531, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3532
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3533
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3532
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3534
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphUpload(((CUgraphExec)__pyx_v_graphExec), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3534, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3535
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3536
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3536, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3535
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphUpload(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3537
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3529
 *     return err
 * 
 * cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphUpload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3539
 *     return err
 * 
 * cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphLaunch(cudaGraphExec_t __pyx_v_graphExec, cudaStream_t __pyx_v_stream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphLaunch", __pyx_f[0], 3539, 1, __PYX_ERR(0, 3539, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3540
 * 
 * cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3541
 * cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3541, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3542
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3543
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3542
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3544
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphLaunch(((CUgraphExec)__pyx_v_graphExec), ((CUstream)__pyx_v_stream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3544, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3545
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3546
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3546, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3545
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphLaunch(<ccuda.CUgraphExec>graphExec, <ccuda.CUstream>stream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3547
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3539
 *     return err
 * 
 * cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphLaunch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3549
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecDestroy(cudaGraphExec_t __pyx_v_graphExec) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecDestroy", __pyx_f[0], 3549, 1, __PYX_ERR(0, 3549, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3550
 * 
 * cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3551
 * cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3551, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3552
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3553
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3552
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3554
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecDestroy(((CUgraphExec)__pyx_v_graphExec)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3554, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3555
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3556
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3556, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3555
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecDestroy(<ccuda.CUgraphExec>graphExec)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3557
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3549
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3559
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDestroy(cudaGraph_t __pyx_v_graph) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphDestroy", __pyx_f[0], 3559, 1, __PYX_ERR(0, 3559, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3560
 * 
 * cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3561
 * cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3561, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3562
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3563
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3562
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3564
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroy(((CUgraph)__pyx_v_graph)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3564, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3565
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3566
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3566, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3565
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDestroy(<ccuda.CUgraph>graph)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3567
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3559
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3569
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDebugDotPrint(cudaGraph_t __pyx_v_graph, char const *__pyx_v_path, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphDebugDotPrint", __pyx_f[0], 3569, 1, __PYX_ERR(0, 3569, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3570
 * 
 * cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3571
 * cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3571, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3572
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3573
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3572
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3574
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphDebugDotPrint(((CUgraph)__pyx_v_graph), __pyx_v_path, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3574, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3575
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3576
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3576, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3575
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphDebugDotPrint(<ccuda.CUgraph>graph, path, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3577
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3569
 *     return err
 * 
 * cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphDebugDotPrint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3579
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectCreate(cudaUserObject_t *__pyx_v_object_out, void *__pyx_v_ptr, cudaHostFn_t __pyx_v_destroy, unsigned int __pyx_v_initialRefcount, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaUserObjectCreate", __pyx_f[0], 3579, 1, __PYX_ERR(0, 3579, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3580
 * 
 * cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3581
 * cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3581, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3582
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3583
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3582
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3584
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectCreate(((CUuserObject *)__pyx_v_object_out), __pyx_v_ptr, ((CUhostFn)__pyx_v_destroy), __pyx_v_initialRefcount, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3584, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3585
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3586
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3586, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3585
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectCreate(<ccuda.CUuserObject*>object_out, ptr, <ccuda.CUhostFn>destroy, initialRefcount, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3587
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3579
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaUserObjectCreate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3589
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectRetain(cudaUserObject_t __pyx_v_object, unsigned int __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaUserObjectRetain", __pyx_f[0], 3589, 1, __PYX_ERR(0, 3589, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3590
 * 
 * cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3591
 * cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3591, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3592
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3593
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3592
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3594
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRetain(((CUuserObject)__pyx_v_object), __pyx_v_count); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3594, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3595
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3596
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3596, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3595
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRetain(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3597
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3589
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaUserObjectRetain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3599
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectRelease(cudaUserObject_t __pyx_v_object, unsigned int __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaUserObjectRelease", __pyx_f[0], 3599, 1, __PYX_ERR(0, 3599, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3600
 * 
 * cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3601
 * cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3601, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3602
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3603
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3602
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3604
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRelease(((CUuserObject)__pyx_v_object), __pyx_v_count); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3604, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3605
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3606
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3606, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3605
 *         return err
 *     err = <cudaError_t>ccuda._cuUserObjectRelease(<ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3607
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3599
 *     return err
 * 
 * cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaUserObjectRelease", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3609
 *     return err
 * 
 * cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphRetainUserObject(cudaGraph_t __pyx_v_graph, cudaUserObject_t __pyx_v_object, unsigned int __pyx_v_count, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphRetainUserObject", __pyx_f[0], 3609, 1, __PYX_ERR(0, 3609, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3610
 * 
 * cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3611
 * cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3611, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3612
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3613
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3612
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3614
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphRetainUserObject(((CUgraph)__pyx_v_graph), ((CUuserObject)__pyx_v_object), __pyx_v_count, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3614, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3615
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3616
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3616, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3615
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphRetainUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3617
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3609
 *     return err
 * 
 * cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphRetainUserObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3619
 *     return err
 * 
 * cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphReleaseUserObject(cudaGraph_t __pyx_v_graph, cudaUserObject_t __pyx_v_object, unsigned int __pyx_v_count) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphReleaseUserObject", __pyx_f[0], 3619, 1, __PYX_ERR(0, 3619, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3620
 * 
 * cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3621
 * cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3621, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3622
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3623
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3622
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3624
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphReleaseUserObject(((CUgraph)__pyx_v_graph), ((CUuserObject)__pyx_v_object), __pyx_v_count); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3624, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3625
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3626
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3626, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3625
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphReleaseUserObject(<ccuda.CUgraph>graph, <ccuda.CUuserObject>object, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3627
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3619
 *     return err
 * 
 * cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphReleaseUserObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3629
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerStart(void) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaProfilerStart", __pyx_f[0], 3629, 1, __PYX_ERR(0, 3629, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3630
 * 
 * cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3631
 * cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3631, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3632
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3633
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3632
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3634
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStart()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStart(); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3634, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3635
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3636
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3636, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3635
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStart()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3637
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3629
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaProfilerStart", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3639
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerStop(void) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaProfilerStop", __pyx_f[0], 3639, 1, __PYX_ERR(0, 3639, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3640
 * 
 * cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3641
 * cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3641, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3642
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3643
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3642
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3644
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStop()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStop(); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3644, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3645
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3646
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3646, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3645
 *         return err
 *     err = <cudaError_t>ccuda._cuProfilerStop()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3647
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3639
 *     return err
 * 
 * cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaProfilerStop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3649
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t *__pyx_v_pCudaResource, __pyx_t_4cuda_7ccudart_EGLImageKHR __pyx_v_image, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphicsEGLRegisterImage", __pyx_f[0], 3649, 1, __PYX_ERR(0, 3649, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3650
 * 
 * cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3651
 * cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3651, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3652
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3653
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3652
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3654
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsEGLRegisterImage(((CUgraphicsResource *)__pyx_v_pCudaResource), __pyx_v_image, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3654, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3655
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3656
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3656, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3655
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphicsEGLRegisterImage(<ccuda.CUgraphicsResource*>pCudaResource, image, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3657
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3649
 *     return err
 * 
 * cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphicsEGLRegisterImage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3659
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerConnect(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_EGLStreamKHR __pyx_v_eglStream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamConsumerConnect", __pyx_f[0], 3659, 1, __PYX_ERR(0, 3659, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3660
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3661
 * cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3661, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3662
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3663
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3662
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3664
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnect(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), __pyx_v_eglStream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3664, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3665
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3666
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3666, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3665
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3667
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3659
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamConsumerConnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3669
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerConnectWithFlags(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_EGLStreamKHR __pyx_v_eglStream, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamConsumerConnectWithFlags", __pyx_f[0], 3669, 1, __PYX_ERR(0, 3669, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3670
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3671
 * cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3671, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3672
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3673
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3672
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3674
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnectWithFlags(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), __pyx_v_eglStream, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3674, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3675
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3676
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3676, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3675
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerConnectWithFlags(<ccuda.CUeglStreamConnection*>conn, eglStream, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3677
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3669
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamConsumerConnectWithFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3679
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerDisconnect(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamConsumerDisconnect", __pyx_f[0], 3679, 1, __PYX_ERR(0, 3679, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3680
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3681
 * cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3681, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3682
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3683
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3682
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3684
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerDisconnect(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3684, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3685
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3686
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3686, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3685
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3687
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3679
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamConsumerDisconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3689
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerAcquireFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, cudaGraphicsResource_t *__pyx_v_pCudaResource, cudaStream_t *__pyx_v_pStream, unsigned int __pyx_v_timeout) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamConsumerAcquireFrame", __pyx_f[0], 3689, 1, __PYX_ERR(0, 3689, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3690
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3691
 * cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3691, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3692
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3693
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3692
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3694
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerAcquireFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), ((CUgraphicsResource *)__pyx_v_pCudaResource), ((CUstream *)__pyx_v_pStream), __pyx_v_timeout); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3694, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3695
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3696
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3696, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3695
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerAcquireFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource*>pCudaResource, <ccuda.CUstream*>pStream, timeout)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3697
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3689
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamConsumerAcquireFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3699
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerReleaseFrame(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, cudaGraphicsResource_t __pyx_v_pCudaResource, cudaStream_t *__pyx_v_pStream) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamConsumerReleaseFrame", __pyx_f[0], 3699, 1, __PYX_ERR(0, 3699, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3700
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3701
 * cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3701, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3702
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3703
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3702
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3704
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerReleaseFrame(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), ((CUgraphicsResource)__pyx_v_pCudaResource), ((CUstream *)__pyx_v_pStream)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3704, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3705
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3706
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3706, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3705
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamConsumerReleaseFrame(<ccuda.CUeglStreamConnection*>conn, <ccuda.CUgraphicsResource>pCudaResource, <ccuda.CUstream*>pStream)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3707
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3699
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamConsumerReleaseFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3709
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerConnect(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn, __pyx_t_4cuda_7ccudart_EGLStreamKHR __pyx_v_eglStream, __pyx_t_4cuda_7ccudart_EGLint __pyx_v_width, __pyx_t_4cuda_7ccudart_EGLint __pyx_v_height) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamProducerConnect", __pyx_f[0], 3709, 1, __PYX_ERR(0, 3709, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3710
 * 
 * cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3711
 * cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3711, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3712
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3713
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3712
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3714
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerConnect(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn), __pyx_v_eglStream, __pyx_v_width, __pyx_v_height); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3714, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3715
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3716
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3716, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3715
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerConnect(<ccuda.CUeglStreamConnection*>conn, eglStream, width, height)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3717
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3709
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerConnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3719
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerDisconnect(__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *__pyx_v_conn) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEGLStreamProducerDisconnect", __pyx_f[0], 3719, 1, __PYX_ERR(0, 3719, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3720
 * 
 * cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3721
 * cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3721, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3722
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3723
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3722
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3724
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerDisconnect(((__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)__pyx_v_conn)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3724, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3725
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3726
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3726, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3725
 *         return err
 *     err = <cudaError_t>ccuda._cuEGLStreamProducerDisconnect(<ccuda.CUeglStreamConnection*>conn)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3727
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3719
 *     return err
 * 
 * cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEGLStreamProducerDisconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3729
 *     return err
 * 
 * cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreateFromEGLSync(cudaEvent_t *__pyx_v_phEvent, __pyx_t_4cuda_7ccudart_EGLSyncKHR __pyx_v_eglSync, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaEventCreateFromEGLSync", __pyx_f[0], 3729, 1, __PYX_ERR(0, 3729, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3730
 * 
 * cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3731
 * cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3731, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3732
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3733
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3732
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3734
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuEventCreateFromEGLSync(((CUevent *)__pyx_v_phEvent), __pyx_v_eglSync, __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3734, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3735
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3736
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3736, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3735
 *         return err
 *     err = <cudaError_t>ccuda._cuEventCreateFromEGLSync(<ccuda.CUevent*>phEvent, eglSync, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3737
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaInitDevice(int deviceOrdinal, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3729
 *     return err
 * 
 * cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaEventCreateFromEGLSync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3739
 *     return err
 * 
 * cdef cudaError_t _cudaInitDevice(int deviceOrdinal, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaInitDevice(int __pyx_v_deviceOrdinal, unsigned int __pyx_v_deviceFlags, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device;
  unsigned int __pyx_v_scheduleFlags;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_t_3;
  CUresult __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaInitDevice", __pyx_f[0], 3739, 1, __PYX_ERR(0, 3739, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3740
 * 
 * cdef cudaError_t _cudaInitDevice(int deviceOrdinal, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaPythonDevice *device
 *     cdef unsigned int scheduleFlags
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3744
 *     cdef unsigned int scheduleFlags
 * 
 *     err = m_global.lazyInitDriver()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitDriver(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3744, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3745
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3746
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3745
 * 
 *     err = m_global.lazyInitDriver()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3748
 *         return err
 * 
 *     device = m_global.getDevice(deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if device == NULL:
 *         _setLastError(cudaErrorInvalidDevice)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global, __pyx_v_deviceOrdinal); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3748, __pyx_L1_error)
  __pyx_v_device = __pyx_t_3;

  /* "cuda/_lib/ccudart/ccudart.pyx":3749
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidDevice)
 *         return cudaErrorInvalidDevice
 */
  __pyx_t_2 = (__pyx_v_device == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3750
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:
 *         _setLastError(cudaErrorInvalidDevice)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDevice
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3750, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3751
 *     if device == NULL:
 *         _setLastError(cudaErrorInvalidDevice)
 *         return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 * 
 *     if device.primaryContext == NULL:
 */
    __pyx_r = cudaErrorInvalidDevice;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3749
 * 
 *     device = m_global.getDevice(deviceOrdinal)
 *     if device == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidDevice)
 *         return cudaErrorInvalidDevice
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3753
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  __pyx_t_2 = (__pyx_v_device->primaryContext == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3754
 * 
 *     if device.primaryContext == NULL:
 *         initPrimaryContext(device)             # <<<<<<<<<<<<<<
 * 
 *     if flags & cudaInitDeviceFlagsAreValid:
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(__pyx_v_device); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3754, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3753
 *         return cudaErrorInvalidDevice
 * 
 *     if device.primaryContext == NULL:             # <<<<<<<<<<<<<<
 *         initPrimaryContext(device)
 * 
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3756
 *         initPrimaryContext(device)
 * 
 *     if flags & cudaInitDeviceFlagsAreValid:             # <<<<<<<<<<<<<<
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask
 *         deviceFlags &= ~cudaDeviceMapHost
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaInitDeviceFlagsAreValid) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3757
 * 
 *     if flags & cudaInitDeviceFlagsAreValid:
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask             # <<<<<<<<<<<<<<
 *         deviceFlags &= ~cudaDeviceMapHost
 *         if deviceFlags & ~cudaDeviceMask:
 */
    __pyx_v_scheduleFlags = (__pyx_v_deviceFlags & __pyx_e_4cuda_7ccudart_cudaDeviceScheduleMask);

    /* "cuda/_lib/ccudart/ccudart.pyx":3758
 *     if flags & cudaInitDeviceFlagsAreValid:
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask
 *         deviceFlags &= ~cudaDeviceMapHost             # <<<<<<<<<<<<<<
 *         if deviceFlags & ~cudaDeviceMask:
 *             _setLastError(cudaErrorInvalidValue)
 */
    __pyx_v_deviceFlags = (__pyx_v_deviceFlags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMapHost));

    /* "cuda/_lib/ccudart/ccudart.pyx":3759
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask
 *         deviceFlags &= ~cudaDeviceMapHost
 *         if deviceFlags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue
 */
    __pyx_t_2 = ((__pyx_v_deviceFlags & (~__pyx_e_4cuda_7ccudart_cudaDeviceMask)) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":3760
 *         deviceFlags &= ~cudaDeviceMapHost
 *         if deviceFlags & ~cudaDeviceMask:
 *             _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         if scheduleFlags:
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3760, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":3761
 *         if deviceFlags & ~cudaDeviceMask:
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         if scheduleFlags:
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":3759
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask
 *         deviceFlags &= ~cudaDeviceMapHost
 *         if deviceFlags & ~cudaDeviceMask:             # <<<<<<<<<<<<<<
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":3762
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue
 *         if scheduleFlags:             # <<<<<<<<<<<<<<
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:
 *                 _setLastError(cudaErrorInvalidValue)
 */
    __pyx_t_2 = (__pyx_v_scheduleFlags != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":3763
 *             return cudaErrorInvalidValue
 *         if scheduleFlags:
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:             # <<<<<<<<<<<<<<
 *                 _setLastError(cudaErrorInvalidValue)
 *                 return cudaErrorInvalidValue
 */
      switch (__pyx_v_scheduleFlags) {
        case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleSpin:
        case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleYield:
        case __pyx_e_4cuda_7ccudart_cudaDeviceScheduleBlockingSync:
        __pyx_t_2 = 0;
        break;
        default:
        __pyx_t_2 = 1;
        break;
      }
      if (__pyx_t_2) {

        /* "cuda/_lib/ccudart/ccudart.pyx":3764
 *         if scheduleFlags:
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:
 *                 _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidValue
 * 
 */
        __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3764, __pyx_L1_error)

        /* "cuda/_lib/ccudart/ccudart.pyx":3765
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:
 *                 _setLastError(cudaErrorInvalidValue)
 *                 return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, deviceFlags)
 */
        __pyx_r = cudaErrorInvalidValue;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/ccudart.pyx":3763
 *             return cudaErrorInvalidValue
 *         if scheduleFlags:
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:             # <<<<<<<<<<<<<<
 *                 _setLastError(cudaErrorInvalidValue)
 *                 return cudaErrorInvalidValue
 */
      }

      /* "cuda/_lib/ccudart/ccudart.pyx":3762
 *             _setLastError(cudaErrorInvalidValue)
 *             return cudaErrorInvalidValue
 *         if scheduleFlags:             # <<<<<<<<<<<<<<
 *             if scheduleFlags != cudaDeviceScheduleSpin and scheduleFlags != cudaDeviceScheduleYield and scheduleFlags != cudaDeviceScheduleBlockingSync:
 *                 _setLastError(cudaErrorInvalidValue)
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":3767
 *                 return cudaErrorInvalidValue
 * 
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, deviceFlags)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2((__pyx_v_device[0]).driverDevice, __pyx_v_deviceFlags); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3767, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/ccudart.pyx":3768
 * 
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, deviceFlags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/ccudart.pyx":3769
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, deviceFlags)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *     return cudaSuccess
 */
      __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3769, __pyx_L1_error)

      /* "cuda/_lib/ccudart/ccudart.pyx":3770
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/ccudart.pyx":3768
 * 
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxSetFlags_v2(device[0].driverDevice, deviceFlags)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/ccudart.pyx":3756
 *         initPrimaryContext(device)
 * 
 *     if flags & cudaInitDeviceFlagsAreValid:             # <<<<<<<<<<<<<<
 *         scheduleFlags = deviceFlags & cudaDeviceScheduleMask
 *         deviceFlags &= ~cudaDeviceMapHost
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3771
 *             _setLastError(err)
 *             return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3739
 *     return err
 * 
 * cdef cudaError_t _cudaInitDevice(int deviceOrdinal, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaPythonDevice *device
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaInitDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3773
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetId(cudaStream_t __pyx_v_hStream, unsigned PY_LONG_LONG *__pyx_v_streamId) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaStreamGetId", __pyx_f[0], 3773, 1, __PYX_ERR(0, 3773, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3774
 * 
 * cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3775
 * cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3775, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3776
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3777
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3776
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3778
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetId(((CUstream)__pyx_v_hStream), __pyx_v_streamId); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3778, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3779
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3780
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3780, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3779
 *         return err
 *     err = <cudaError_t>ccuda._cuStreamGetId(<ccuda.CUstream>hStream, streamId)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3781
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3773
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaStreamGetId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3783
 *     return err
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithParams(cudaGraphExec_t *__pyx_v_pGraphExec, cudaGraph_t __pyx_v_graph, cudaGraphInstantiateParams *__pyx_v_instantiateParams) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphInstantiateWithParams", __pyx_f[0], 3783, 1, __PYX_ERR(0, 3783, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3784
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3785
 * cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3785, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3786
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3787
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3786
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3788
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithParams(((CUgraphExec *)__pyx_v_pGraphExec), ((CUgraph)__pyx_v_graph), ((CUDA_GRAPH_INSTANTIATE_PARAMS *)__pyx_v_instantiateParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3788, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3789
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3790
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3790, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3789
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphInstantiateWithParams(<ccuda.CUgraphExec*>pGraphExec, <ccuda.CUgraph>graph, <ccuda.CUDA_GRAPH_INSTANTIATE_PARAMS*>instantiateParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3791
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3783
 *     return err
 * 
 * cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphInstantiateWithParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3793
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecGetFlags(cudaGraphExec_t __pyx_v_graphExec, unsigned PY_LONG_LONG *__pyx_v_flags) {
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecGetFlags", __pyx_f[0], 3793, 1, __PYX_ERR(0, 3793, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3794
 * 
 * cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3795
 * cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3795, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/ccudart.pyx":3796
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3797
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3796
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3798
 *     if err != cudaSuccess:
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecGetFlags(((CUgraphExec)__pyx_v_graphExec), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3798, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3799
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3800
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3800, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3799
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecGetFlags(<ccuda.CUgraphExec>graphExec, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *     return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3801
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3793
 *     return err
 * 
 * cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecGetFlags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3803
 *     return err
 * 
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if kernelPtr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetKernel(cudaKernel_t *__pyx_v_kernelPtr, void const *__pyx_v_entryFuncAddr) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGetKernel", __pyx_f[0], 3803, 1, __PYX_ERR(0, 3803, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3804
 * 
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if kernelPtr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_kernelPtr == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3805
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if kernelPtr == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     if entryFuncAddr == NULL:
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3805, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3806
 *     if kernelPtr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     if entryFuncAddr == NULL:
 *         _setLastError(cudaErrorInvalidDeviceFunction)
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3804
 * 
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if kernelPtr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3807
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     if entryFuncAddr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidDeviceFunction)
 *         return cudaErrorInvalidDeviceFunction
 */
  __pyx_t_1 = (__pyx_v_entryFuncAddr == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3808
 *         return cudaErrorInvalidValue
 *     if entryFuncAddr == NULL:
 *         _setLastError(cudaErrorInvalidDeviceFunction)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidDeviceFunction
 * 
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidDeviceFunction); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3808, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3809
 *     if entryFuncAddr == NULL:
 *         _setLastError(cudaErrorInvalidDeviceFunction)
 *         return cudaErrorInvalidDeviceFunction             # <<<<<<<<<<<<<<
 * 
 *     kernelPtr[0] = <cudaKernel_t>entryFuncAddr;
 */
    __pyx_r = cudaErrorInvalidDeviceFunction;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3807
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     if entryFuncAddr == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidDeviceFunction)
 *         return cudaErrorInvalidDeviceFunction
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3811
 *         return cudaErrorInvalidDeviceFunction
 * 
 *     kernelPtr[0] = <cudaKernel_t>entryFuncAddr;             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_kernelPtr[0]) = ((cudaKernel_t)__pyx_v_entryFuncAddr);

  /* "cuda/_lib/ccudart/ccudart.pyx":3812
 * 
 *     kernelPtr[0] = <cudaKernel_t>entryFuncAddr;
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3803
 *     return err
 * 
 * cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if kernelPtr == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGetKernel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3814
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddNode(cudaGraphNode_t *__pyx_v_pGraphNode, cudaGraph_t __pyx_v_graph, cudaGraphNode_t const *__pyx_v_pDependencies, size_t __pyx_v_numDependencies, struct cudaGraphNodeParams *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  CUgraphNodeParams __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphAddNode", __pyx_f[0], 3814, 1, __PYX_ERR(0, 3814, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3815
 * 
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_nodeParams == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3816
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3816, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3817
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3815
 * 
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3818
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3819
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3819, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3820
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3821
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3821, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3822
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3820
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3824
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams(__pyx_v_nodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3824, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3825
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3826
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3826, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3827
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3825
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3828
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddNode(__pyx_v_pGraphNode, __pyx_v_graph, __pyx_v_pDependencies, __pyx_v_numDependencies, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3828, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3829
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3830
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3830, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3831
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams)
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3829
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3832
 *         _setLastError(err)
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams)             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams((&__pyx_v_driverNodeParams), __pyx_v_nodeParams); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3832, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3833
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams)
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3814
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphAddNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3835
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeSetParams(cudaGraphNode_t __pyx_v_node, struct cudaGraphNodeParams *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  CUgraphNodeParams __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphNodeSetParams", __pyx_f[0], 3835, 1, __PYX_ERR(0, 3835, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3836
 * 
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_nodeParams == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3837
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3837, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3838
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3836
 * 
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3839
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3840
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3840, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3841
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3842
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3842, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3843
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3841
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3845
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams(__pyx_v_nodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3845, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3846
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3847
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3847, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3848
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3846
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3849
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetParams(__pyx_v_node, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3849, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3850
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3851
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3851, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3852
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3850
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphNodeSetParams(node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3853
 *         _setLastError(err)
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams((&__pyx_v_driverNodeParams), __pyx_v_nodeParams); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3853, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3854
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3835
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/ccudart.pyx":3856
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecNodeSetParams(cudaGraphExec_t __pyx_v_graphExec, cudaGraphNode_t __pyx_v_node, struct cudaGraphNodeParams *__pyx_v_nodeParams) {
  cudaError_t __pyx_v_err;
  CUgraphNodeParams __pyx_v_driverNodeParams;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("_cudaGraphExecNodeSetParams", __pyx_f[0], 3856, 1, __PYX_ERR(0, 3856, __pyx_L1_error));

  /* "cuda/_lib/ccudart/ccudart.pyx":3857
 * 
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_nodeParams == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3858
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(cudaErrorInvalidValue); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3858, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3859
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3857
 * 
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if nodeParams == NULL:             # <<<<<<<<<<<<<<
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3860
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/ccudart.pyx":3861
 *         return cudaErrorInvalidValue
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global->__pyx_vtab)->lazyInitContextState(__pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3861, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3862
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3863
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3863, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3864
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3862
 *     cdef cudaError_t err = cudaSuccess
 *     err = m_global.lazyInitContextState()
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3866
 *         return err
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams(__pyx_v_nodeParams, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3866, __pyx_L1_error)
  __pyx_v_err = __pyx_t_2;

  /* "cuda/_lib/ccudart/ccudart.pyx":3867
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3868
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3868, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3869
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3867
 *     cdef ccuda.CUgraphNodeParams driverNodeParams
 *     err = toDriverGraphNodeParams(nodeParams, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3870
 *         _setLastError(err)
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecNodeSetParams(__pyx_v_graphExec, __pyx_v_node, (&__pyx_v_driverNodeParams)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3870, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/ccudart.pyx":3871
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/ccudart.pyx":3872
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(__pyx_v_err); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3872, __pyx_L1_error)

    /* "cuda/_lib/ccudart/ccudart.pyx":3873
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/ccudart.pyx":3871
 *         return err
 *     err = <cudaError_t>ccuda._cuGraphExecNodeSetParams(graphExec, node, &driverNodeParams)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/ccudart.pyx":3874
 *         _setLastError(err)
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 */
  __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams((&__pyx_v_driverNodeParams), __pyx_v_nodeParams); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3874, __pyx_L1_error)

  /* "cuda/_lib/ccudart/ccudart.pyx":3875
 *         return err
 *     toCudartGraphNodeOutParams(&driverNodeParams, nodeParams);
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/ccudart.pyx":3856
 *     return cudaSuccess
 * 
 * cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if nodeParams == NULL:
 *         _setLastError(cudaErrorInvalidValue)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.ccudart._cudaGraphExecNodeSetParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#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
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1},
    {&__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}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1124, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  __Pyx_RefNannyFinishContext();
  return 0;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  return 0;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_4cuda_4_lib_7ccudart_7ccudart_m_global = ((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_cudaMemcpy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreate, "cudaError_t (cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreate, "cudaError_t (cudaEvent_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventQuery", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventQuery, "cudaError_t (cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateChannelDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateChannelDesc, "struct cudaChannelFormatDesc (int, int, int, int, enum cudaChannelFormatKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDriverGetVersion", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDriverGetVersion, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaRuntimeGetVersion", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaRuntimeGetVersion, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetTexture1DLinearMaxWidth", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetTexture1DLinearMaxWidth, "cudaError_t (size_t *, struct cudaChannelFormatDesc const *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocHost, "cudaError_t (void **, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocPitch", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocPitch, "cudaError_t (void **, size_t *, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, struct cudaExtent, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2D, "cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DAsync, "cudaError_t (void *, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyAsync, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemcpyNode1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemcpyNode1D, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams1D, "cudaError_t (cudaGraphNode_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemcpyNodeSetParams1D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemcpyNodeSetParams1D, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDriverEntryPoint", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDriverEntryPoint, "cudaError_t (char const *, void **, unsigned PY_LONG_LONG, enum cudaDriverEntryPointQueryResult *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemsetNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemsetNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecMemsetNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecMemsetNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemcpyNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemcpyNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncGetAttributes, "cudaError_t (struct cudaFuncAttributes *, void const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3D, "cudaError_t (struct cudaPitchedPtr *, struct cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc3DArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc3DArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, struct cudaExtent, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetErrorString", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetErrorString, "char const *(cudaError_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamAddCallback", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAddCallback, "cudaError_t (cudaStream_t, cudaStreamCallback_t, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetCaptureInfo_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetCaptureInfo_v2, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaImportExternalSemaphore", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalSemaphore, "cudaError_t (cudaExternalSemaphore_t *, struct cudaExternalSemaphoreHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSignalExternalSemaphoresAsync_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSignalExternalSemaphoresAsync_v2, "cudaError_t (cudaExternalSemaphore_t const *, struct cudaExternalSemaphoreSignalParams const *, unsigned int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaWaitExternalSemaphoresAsync_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaWaitExternalSemaphoresAsync_v2, "cudaError_t (cudaExternalSemaphore_t const *, struct cudaExternalSemaphoreWaitParams const *, unsigned int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetInfo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetInfo, "cudaError_t (struct cudaChannelFormatDesc *, struct cudaExtent *, unsigned int *, cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArray, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArray, "cudaError_t (void *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DToArrayAsync, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy2DFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy2DFromArrayAsync, "cudaError_t (void *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3D, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset3DAsync, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArray, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArray, "cudaError_t (void *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyToArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyToArrayAsync, "cudaError_t (cudaArray_t, size_t, size_t, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyFromArrayAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyFromArrayAsync, "cudaError_t (void *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaPointerGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPointerGetAttributes, "cudaError_t (struct cudaPointerAttributes *, void const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceFlags, "cudaError_t (unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3D, "cudaError_t (struct cudaMemcpy3DParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DAsync, "cudaError_t (struct cudaMemcpy3DParms const *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolSetAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAccess, "cudaError_t (cudaMemPool_t, struct cudaMemAccessDesc const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceReset", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceReset, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetLastError", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetLastError, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaPeekAtLastError", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaPeekAtLastError, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDevice, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDevice, "cudaError_t (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceProperties_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceProperties_v2, "cudaError_t (struct cudaDeviceProp *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaChooseDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaChooseDevice, "cudaError_t (int *, struct cudaDeviceProp const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyArrayToArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetChannelDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetChannelDesc, "cudaError_t (struct cudaChannelFormatDesc *, cudaArray_const_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateTextureObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateTextureObject, "cudaError_t (cudaTextureObject_t *, struct cudaResourceDesc const *, struct cudaTextureDesc const *, struct cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectTextureDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectTextureDesc, "cudaError_t (struct cudaTextureDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceViewDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceViewDesc, "cudaError_t (struct cudaResourceViewDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetExportTable", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetExportTable, "cudaError_t (void const **, cudaUUID_t const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeer, "cudaError_t (struct cudaMemcpy3DPeerParms const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpy3DPeerAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpy3DPeerAsync, "cudaError_t (struct cudaMemcpy3DPeerParms const *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaPitchedPtr", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPitchedPtr, "struct cudaPitchedPtr (void *, size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaPos", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaPos, "struct cudaPos (size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_make_cudaExtent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__make_cudaExtent, "struct cudaExtent (size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaSetDeviceFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaSetDeviceFlags, "cudaError_t (unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemAllocNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemAllocNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemAllocNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemAllocNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemAllocNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemFreeNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemFreeNodeGetParams, "cudaError_t (cudaGraphNode_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemAdvise", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise, "cudaError_t (void const *, size_t, enum cudaMemoryAdvise, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemRangeGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttribute, "cudaError_t (void *, size_t, enum cudaMemRangeAttribute, void const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemRangeGetAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemRangeGetAttributes, "cudaError_t (void **, size_t *, enum cudaMemRangeAttribute *, size_t, void const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetDeviceCount", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetDeviceCount, "cudaError_t (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetAttribute, "cudaError_t (int *, enum cudaDeviceAttr, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetSharedMemConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetSharedMemConfig, "cudaError_t (enum cudaSharedMemConfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetByPCIBusId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetByPCIBusId, "cudaError_t (int *, char const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetPCIBusId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetPCIBusId, "cudaError_t (char *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetP2PAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetP2PAttribute, "cudaError_t (int *, enum cudaDeviceP2PAttr, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetSparseProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetSparseProperties, "cudaError_t (struct cudaArraySparseProperties *, cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMipmappedArrayGetSparseProperties", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetSparseProperties, "cudaError_t (struct cudaArraySparseProperties *, cudaMipmappedArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceCanAccessPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceCanAccessPeer, "cudaError_t (int *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyPeer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeer, "cudaError_t (void *, int, void const *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemcpyPeerAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemcpyPeerAsync, "cudaError_t (void *, int, void const *, int, size_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceEnablePeerAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceEnablePeerAccess, "cudaError_t (int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceDisablePeerAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceDisablePeerAccess, "cudaError_t (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaExternalMemoryGetMappedMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, cudaExternalMemory_t, struct cudaExternalMemoryMipmappedArrayDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetSurfaceObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetSurfaceObjectResourceDesc, "cudaError_t (struct cudaResourceDesc *, cudaSurfaceObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaKernelNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaExternalMemoryGetMappedBuffer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaExternalMemoryGetMappedBuffer, "cudaError_t (void **, cudaExternalMemory_t, struct cudaExternalMemoryBufferDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaImportExternalMemory", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaImportExternalMemory, "cudaError_t (cudaExternalMemory_t *, struct cudaExternalMemoryHandleDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCreateSurfaceObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCreateSurfaceObject, "cudaError_t (cudaSurfaceObject_t *, struct cudaResourceDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetTextureObjectResourceDesc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetTextureObjectResourceDesc, "cudaError_t (struct cudaResourceDesc *, cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsEGLRegisterImage", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsEGLRegisterImage, "cudaError_t (cudaGraphicsResource_t *, __pyx_t_4cuda_7ccudart_EGLImageKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerPresentFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerPresentFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_cudaEglFrame, cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerReturnFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerReturnFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_cudaEglFrame *, cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsResourceGetMappedEglFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedEglFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglFrame *, cudaGraphicsResource_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaVDPAUSetVDPAUDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUSetVDPAUDevice, "cudaError_t (int, __pyx_t_4cuda_7ccudart_VdpDevice, __pyx_t_4cuda_7ccudart_VdpGetProcAddress *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetMemoryRequirements", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetMemoryRequirements, "cudaError_t (struct cudaArrayMemoryRequirements *, cudaArray_t, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMipmappedArrayGetMemoryRequirements", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMipmappedArrayGetMemoryRequirements, "cudaError_t (struct cudaArrayMemoryRequirements *, cudaMipmappedArray_t, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetAttribute, "cudaError_t (cudaStream_t, __pyx_t_4cuda_7ccudart_cudaStreamAttrID, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSetAttribute, "cudaError_t (cudaStream_t, __pyx_t_4cuda_7ccudart_cudaStreamAttrID, __pyx_t_4cuda_7ccudart_cudaStreamAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeGetAttribute, "cudaError_t (cudaGraphNode_t, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetAttribute, "cudaError_t (cudaGraphNode_t, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrID, __pyx_t_4cuda_7ccudart_cudaKernelNodeAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaVDPAUGetDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaVDPAUGetDevice, "cudaError_t (int *, __pyx_t_4cuda_7ccudart_VdpDevice, __pyx_t_4cuda_7ccudart_VdpGetProcAddress *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsVDPAURegisterVideoSurface", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsVDPAURegisterVideoSurface, "cudaError_t (struct cudaGraphicsResource **, __pyx_t_4cuda_7ccudart_VdpVideoSurface, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsVDPAURegisterOutputSurface", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsVDPAURegisterOutputSurface, "cudaError_t (struct cudaGraphicsResource **, __pyx_t_4cuda_7ccudart_VdpOutputSurface, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGLGetDevices", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGLGetDevices, "cudaError_t (unsigned int *, int *, unsigned int, enum __pyx_t_4cuda_7ccudart_cudaGLDeviceList)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsGLRegisterImage", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsGLRegisterImage, "cudaError_t (struct cudaGraphicsResource **, __pyx_t_4cuda_7ccudart_GLuint, __pyx_t_4cuda_7ccudart_GLenum, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsGLRegisterBuffer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsGLRegisterBuffer, "cudaError_t (struct cudaGraphicsResource **, __pyx_t_4cuda_7ccudart_GLuint, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSynchronize", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSynchronize, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetLimit", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetLimit, "cudaError_t (enum cudaLimit, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetLimit", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetLimit, "cudaError_t (size_t *, enum cudaLimit)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetCacheConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetCacheConfig, "cudaError_t (enum cudaFuncCache *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetStreamPriorityRange", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetStreamPriorityRange, "cudaError_t (int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetCacheConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetCacheConfig, "cudaError_t (enum cudaFuncCache)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetSharedMemConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetSharedMemConfig, "cudaError_t (enum cudaSharedMemConfig *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaIpcGetEventHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcGetEventHandle, "cudaError_t (cudaIpcEventHandle_t *, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaIpcOpenEventHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcOpenEventHandle, "cudaError_t (cudaEvent_t *, cudaIpcEventHandle_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaIpcGetMemHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcGetMemHandle, "cudaError_t (cudaIpcMemHandle_t *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaIpcOpenMemHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcOpenMemHandle, "cudaError_t (void **, cudaIpcMemHandle_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaIpcCloseMemHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaIpcCloseMemHandle, "cudaError_t (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceFlushGPUDirectRDMAWrites", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceFlushGPUDirectRDMAWrites, "cudaError_t (enum cudaFlushGPUDirectRDMAWritesTarget, enum cudaFlushGPUDirectRDMAWritesScope)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetDefaultMemPool", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetDefaultMemPool, "cudaError_t (cudaMemPool_t *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetMemPool", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetMemPool, "cudaError_t (int, cudaMemPool_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetMemPool", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetMemPool, "cudaError_t (cudaMemPool_t *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetNvSciSyncAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetNvSciSyncAttributes, "cudaError_t (void *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCreateWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreateWithFlags, "cudaError_t (cudaStream_t *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCreateWithPriority", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCreateWithPriority, "cudaError_t (cudaStream_t *, unsigned int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetPriority", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetPriority, "cudaError_t (cudaStream_t, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetFlags, "cudaError_t (cudaStream_t, unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaCtxResetPersistingL2Cache", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaCtxResetPersistingL2Cache, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamCopyAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamCopyAttributes, "cudaError_t (cudaStream_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamDestroy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamDestroy, "cudaError_t (cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamWaitEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamWaitEvent, "cudaError_t (cudaStream_t, cudaEvent_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamSynchronize", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamSynchronize, "cudaError_t (cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamQuery", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamQuery, "cudaError_t (cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamAttachMemAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamAttachMemAsync, "cudaError_t (cudaStream_t, void *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamBeginCapture", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamBeginCapture, "cudaError_t (cudaStream_t, enum cudaStreamCaptureMode)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaThreadExchangeStreamCaptureMode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaThreadExchangeStreamCaptureMode, "cudaError_t (enum cudaStreamCaptureMode *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamEndCapture", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamEndCapture, "cudaError_t (cudaStream_t, cudaGraph_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamIsCapturing", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamIsCapturing, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamUpdateCaptureDependencies", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamUpdateCaptureDependencies, "cudaError_t (cudaStream_t, cudaGraphNode_t *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventCreateWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreateWithFlags, "cudaError_t (cudaEvent_t *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventRecord", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventRecord, "cudaError_t (cudaEvent_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventRecordWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventRecordWithFlags, "cudaError_t (cudaEvent_t, cudaStream_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventSynchronize", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventSynchronize, "cudaError_t (cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventDestroy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventDestroy, "cudaError_t (cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventElapsedTime", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventElapsedTime, "cudaError_t (float *, cudaEvent_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDestroyExternalMemory", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyExternalMemory, "cudaError_t (cudaExternalMemory_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDestroyExternalSemaphore", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyExternalSemaphore, "cudaError_t (cudaExternalSemaphore_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncSetCacheConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetCacheConfig, "cudaError_t (void const *, enum cudaFuncCache)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncSetSharedMemConfig", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetSharedMemConfig, "cudaError_t (void const *, enum cudaSharedMemConfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFuncSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFuncSetAttribute, "cudaError_t (void const *, enum cudaFuncAttribute, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaLaunchHostFunc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaLaunchHostFunc, "cudaError_t (cudaStream_t, cudaHostFn_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaOccupancyMaxActiveBlocksPerMultiprocessor", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyMaxActiveBlocksPerMultiprocessor, "cudaError_t (int *, void const *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaOccupancyAvailableDynamicSMemPerBlock", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyAvailableDynamicSMemPerBlock, "cudaError_t (size_t *, void const *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, "cudaError_t (int *, void const *, int, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocManaged", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocManaged, "cudaError_t (void **, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMalloc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMalloc, "cudaError_t (void **, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFree", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFree, "cudaError_t (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFreeHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeHost, "cudaError_t (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFreeArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeArray, "cudaError_t (cudaArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFreeMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeMipmappedArray, "cudaError_t (cudaMipmappedArray_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaHostAlloc", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostAlloc, "cudaError_t (void **, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaHostRegister", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostRegister, "cudaError_t (void *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaHostUnregister", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostUnregister, "cudaError_t (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaHostGetDevicePointer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostGetDevicePointer, "cudaError_t (void **, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaHostGetFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaHostGetFlags, "cudaError_t (unsigned int *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetMipmappedArrayLevel", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetMipmappedArrayLevel, "cudaError_t (cudaArray_t *, cudaMipmappedArray_const_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemGetInfo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemGetInfo, "cudaError_t (size_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaArrayGetPlane", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaArrayGetPlane, "cudaError_t (cudaArray_t *, cudaArray_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset, "cudaError_t (void *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset2D, "cudaError_t (void *, size_t, int, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemsetAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemsetAsync, "cudaError_t (void *, int, size_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemset2DAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemset2DAsync, "cudaError_t (void *, size_t, int, size_t, size_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPrefetchAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPrefetchAsync, "cudaError_t (void const *, size_t, int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocAsync, "cudaError_t (void **, size_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaFreeAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaFreeAsync, "cudaError_t (void *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolTrimTo", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolTrimTo, "cudaError_t (cudaMemPool_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolSetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolSetAttribute, "cudaError_t (cudaMemPool_t, enum cudaMemPoolAttr, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolGetAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolGetAttribute, "cudaError_t (cudaMemPool_t, enum cudaMemPoolAttr, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolGetAccess", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolGetAccess, "cudaError_t (enum cudaMemAccessFlags *, cudaMemPool_t, struct cudaMemLocation *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolCreate, "cudaError_t (cudaMemPool_t *, struct cudaMemPoolProps const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolDestroy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolDestroy, "cudaError_t (cudaMemPool_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMallocFromPoolAsync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMallocFromPoolAsync, "cudaError_t (void **, size_t, cudaMemPool_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolExportToShareableHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolExportToShareableHandle, "cudaError_t (void *, cudaMemPool_t, enum cudaMemAllocationHandleType, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolImportFromShareableHandle", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolImportFromShareableHandle, "cudaError_t (cudaMemPool_t *, void *, enum cudaMemAllocationHandleType, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolExportPointer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolExportPointer, "cudaError_t (struct cudaMemPoolPtrExportData *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPoolImportPointer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPoolImportPointer, "cudaError_t (void **, cudaMemPool_t, struct cudaMemPoolPtrExportData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsUnregisterResource", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsUnregisterResource, "cudaError_t (cudaGraphicsResource_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsResourceSetMapFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceSetMapFlags, "cudaError_t (cudaGraphicsResource_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsMapResources", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsMapResources, "cudaError_t (int, cudaGraphicsResource_t *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsUnmapResources", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsUnmapResources, "cudaError_t (int, cudaGraphicsResource_t *, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsResourceGetMappedPointer", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedPointer, "cudaError_t (void **, size_t *, cudaGraphicsResource_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsSubResourceGetMappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsSubResourceGetMappedArray, "cudaError_t (cudaArray_t *, cudaGraphicsResource_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphicsResourceGetMappedMipmappedArray", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphicsResourceGetMappedMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, cudaGraphicsResource_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDestroyTextureObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroyTextureObject, "cudaError_t (cudaTextureObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDestroySurfaceObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDestroySurfaceObject, "cudaError_t (cudaSurfaceObject_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphCreate, "cudaError_t (cudaGraph_t *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddKernelNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddKernelNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaKernelNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaKernelNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphKernelNodeCopyAttributes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphKernelNodeCopyAttributes, "cudaError_t (cudaGraphNode_t, cudaGraphNode_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemsetNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemsetNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemsetParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphMemsetNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphMemsetNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaMemsetParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddHostNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddHostNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaHostNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphHostNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphHostNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaHostNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphHostNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphHostNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaHostNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddChildGraphNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddChildGraphNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, cudaGraph_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphChildGraphNodeGetGraph", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphChildGraphNodeGetGraph, "cudaError_t (cudaGraphNode_t, cudaGraph_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddEmptyNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEmptyNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddEventRecordNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEventRecordNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphEventRecordNodeGetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventRecordNodeGetEvent, "cudaError_t (cudaGraphNode_t, cudaEvent_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphEventRecordNodeSetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventRecordNodeSetEvent, "cudaError_t (cudaGraphNode_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddEventWaitNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddEventWaitNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphEventWaitNodeGetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventWaitNodeGetEvent, "cudaError_t (cudaGraphNode_t, cudaEvent_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphEventWaitNodeSetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphEventWaitNodeSetEvent, "cudaError_t (cudaGraphNode_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddExternalSemaphoresSignalNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddExternalSemaphoresSignalNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaExternalSemaphoreSignalNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExternalSemaphoresSignalNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresSignalNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaExternalSemaphoreSignalNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExternalSemaphoresSignalNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresSignalNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaExternalSemaphoreSignalNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddExternalSemaphoresWaitNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddExternalSemaphoresWaitNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaExternalSemaphoreWaitNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExternalSemaphoresWaitNodeGetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresWaitNodeGetParams, "cudaError_t (cudaGraphNode_t, struct cudaExternalSemaphoreWaitNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExternalSemaphoresWaitNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExternalSemaphoresWaitNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaExternalSemaphoreWaitNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddMemFreeNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddMemFreeNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGraphMemTrim", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGraphMemTrim, "cudaError_t (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceGetGraphMemAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceGetGraphMemAttribute, "cudaError_t (int, enum cudaGraphMemAttributeType, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaDeviceSetGraphMemAttribute", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaDeviceSetGraphMemAttribute, "cudaError_t (int, enum cudaGraphMemAttributeType, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphClone", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphClone, "cudaError_t (cudaGraph_t *, cudaGraph_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeFindInClone", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeFindInClone, "cudaError_t (cudaGraphNode_t *, cudaGraphNode_t, cudaGraph_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeGetType", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetType, "cudaError_t (cudaGraphNode_t, enum cudaGraphNodeType *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphGetNodes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetNodes, "cudaError_t (cudaGraph_t, cudaGraphNode_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphGetRootNodes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetRootNodes, "cudaError_t (cudaGraph_t, cudaGraphNode_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphGetEdges", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphGetEdges, "cudaError_t (cudaGraph_t, cudaGraphNode_t *, cudaGraphNode_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeGetDependencies", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetDependencies, "cudaError_t (cudaGraphNode_t, cudaGraphNode_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeGetDependentNodes", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetDependentNodes, "cudaError_t (cudaGraphNode_t, cudaGraphNode_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddDependencies", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddDependencies, "cudaError_t (cudaGraph_t, cudaGraphNode_t const *, cudaGraphNode_t const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphRemoveDependencies", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphRemoveDependencies, "cudaError_t (cudaGraph_t, cudaGraphNode_t const *, cudaGraphNode_t const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphDestroyNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDestroyNode, "cudaError_t (cudaGraphNode_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphInstantiate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiate, "cudaError_t (cudaGraphExec_t *, cudaGraph_t, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphInstantiateWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithFlags, "cudaError_t (cudaGraphExec_t *, cudaGraph_t, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecKernelNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecKernelNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaKernelNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecHostNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecHostNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaHostNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecChildGraphNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecChildGraphNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, cudaGraph_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecEventRecordNodeSetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecEventRecordNodeSetEvent, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecEventWaitNodeSetEvent", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecEventWaitNodeSetEvent, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, cudaEvent_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecExternalSemaphoresSignalNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecExternalSemaphoresSignalNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaExternalSemaphoreSignalNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecExternalSemaphoresWaitNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecExternalSemaphoresWaitNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaExternalSemaphoreWaitNodeParams const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeSetEnabled", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeSetEnabled, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeGetEnabled", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeGetEnabled, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecUpdate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecUpdate, "cudaError_t (cudaGraphExec_t, cudaGraph_t, cudaGraphExecUpdateResultInfo *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphUpload", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphUpload, "cudaError_t (cudaGraphExec_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphLaunch", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphLaunch, "cudaError_t (cudaGraphExec_t, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecDestroy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecDestroy, "cudaError_t (cudaGraphExec_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphDestroy", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDestroy, "cudaError_t (cudaGraph_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphDebugDotPrint", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphDebugDotPrint, "cudaError_t (cudaGraph_t, char const *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaUserObjectCreate", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectCreate, "cudaError_t (cudaUserObject_t *, void *, cudaHostFn_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaUserObjectRetain", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectRetain, "cudaError_t (cudaUserObject_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaUserObjectRelease", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaUserObjectRelease, "cudaError_t (cudaUserObject_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphRetainUserObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphRetainUserObject, "cudaError_t (cudaGraph_t, cudaUserObject_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphReleaseUserObject", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphReleaseUserObject, "cudaError_t (cudaGraph_t, cudaUserObject_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaProfilerStart", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerStart, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaProfilerStop", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaProfilerStop, "cudaError_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamConsumerConnect", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerConnect, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_EGLStreamKHR)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamConsumerConnectWithFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerConnectWithFlags, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_EGLStreamKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamConsumerDisconnect", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerDisconnect, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamConsumerAcquireFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerAcquireFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, cudaGraphicsResource_t *, cudaStream_t *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamConsumerReleaseFrame", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamConsumerReleaseFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, cudaGraphicsResource_t, cudaStream_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerConnect", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerConnect, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *, __pyx_t_4cuda_7ccudart_EGLStreamKHR, __pyx_t_4cuda_7ccudart_EGLint, __pyx_t_4cuda_7ccudart_EGLint)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEGLStreamProducerDisconnect", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEGLStreamProducerDisconnect, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglStreamConnection *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaEventCreateFromEGLSync", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaEventCreateFromEGLSync, "cudaError_t (cudaEvent_t *, __pyx_t_4cuda_7ccudart_EGLSyncKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaInitDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaInitDevice, "cudaError_t (int, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaStreamGetId", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaStreamGetId, "cudaError_t (cudaStream_t, unsigned PY_LONG_LONG *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphInstantiateWithParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphInstantiateWithParams, "cudaError_t (cudaGraphExec_t *, cudaGraph_t, cudaGraphInstantiateParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecGetFlags", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecGetFlags, "cudaError_t (cudaGraphExec_t, unsigned PY_LONG_LONG *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGetKernel", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGetKernel, "cudaError_t (cudaKernel_t *, void const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphAddNode", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphAddNode, "cudaError_t (cudaGraphNode_t *, cudaGraph_t, cudaGraphNode_t const *, size_t, struct cudaGraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphNodeSetParams, "cudaError_t (cudaGraphNode_t, struct cudaGraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaGraphExecNodeSetParams", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaGraphExecNodeSetParams, "cudaError_t (cudaGraphExec_t, cudaGraphNode_t, struct cudaGraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemPrefetchAsync_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemPrefetchAsync_v2, "cudaError_t (void const *, size_t, struct cudaMemLocation, unsigned int, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_cudaMemAdvise_v2", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_7ccudart__cudaMemAdvise_v2, "cudaError_t (void const *, size_t, enum cudaMemoryAdvise, struct cudaMemLocation)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cuda._lib.ccudart.utils"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = __Pyx_ImportType_3_0_7(__pyx_t_1, "cuda._lib.ccudart.utils", "cudaPythonGlobal", sizeof(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal), __PYX_GET_STRUCT_ALIGNMENT_3_0_7(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal),__Pyx_ImportType_CheckSize_Warn_3_0_7); if (!__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = (struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal*)__Pyx_GetVtable(__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal); if (unlikely(!__pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal)) __PYX_ERR(1, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cuda.ccuda"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "cuTexObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "cuTexObjectGetResourceViewDesc", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuTexObjectGetResourceViewDesc, "CUresult (CUDA_RESOURCE_VIEW_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cuda._cuda.ccuda"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGetErrorString", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetErrorString, "CUresult (CUresult, char const **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDriverGetVersion", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDriverGetVersion, "CUresult (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetTexture1DLinearMaxWidth", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetTexture1DLinearMaxWidth, "CUresult (size_t *, CUarray_format, unsigned int, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute, "CUresult (int *, CUdevice_attribute, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetNvSciSyncAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetNvSciSyncAttributes, "CUresult (void *, CUdevice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceSetMemPool", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetMemPool, "CUresult (CUdevice, CUmemoryPool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetMemPool", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetMemPool, "CUresult (CUmemoryPool *, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetDefaultMemPool", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetDefaultMemPool, "CUresult (CUmemoryPool *, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuFlushGPUDirectRDMAWrites", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFlushGPUDirectRDMAWrites, "CUresult (CUflushGPUDirectRDMAWritesTarget, CUflushGPUDirectRDMAWritesScope)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDevicePrimaryCtxSetFlags_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxSetFlags_v2, "CUresult (CUdevice, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDevicePrimaryCtxGetState", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxGetState, "CUresult (CUdevice, unsigned int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxSetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent, "CUresult (CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent, "CUresult (CUcontext *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetDevice", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetDevice, "CUresult (CUdevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetFlags, "CUresult (unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxSynchronize", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSynchronize, "CUresult (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxSetLimit", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetLimit, "CUresult (CUlimit, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetLimit", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetLimit, "CUresult (size_t *, CUlimit)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetCacheConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCacheConfig, "CUresult (CUfunc_cache *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxSetCacheConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCacheConfig, "CUresult (CUfunc_cache)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetSharedMemConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetSharedMemConfig, "CUresult (CUsharedconfig *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxSetSharedMemConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetSharedMemConfig, "CUresult (CUsharedconfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxGetStreamPriorityRange", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetStreamPriorityRange, "CUresult (int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxResetPersistingL2Cache", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxResetPersistingL2Cache, "CUresult (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemGetInfo_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemGetInfo_v2, "CUresult (size_t *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAlloc_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAlloc_v2, "CUresult (CUdeviceptr *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemFree_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemFree_v2, "CUresult (CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemFreeHost", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeHost, "CUresult (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemHostAlloc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostAlloc, "CUresult (void **, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemHostGetDevicePointer_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetDevicePointer_v2, "CUresult (CUdeviceptr *, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemHostGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostGetFlags, "CUresult (unsigned int *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAllocManaged", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocManaged, "CUresult (CUdeviceptr *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetByPCIBusId", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetByPCIBusId, "CUresult (CUdevice *, char const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetPCIBusId", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetPCIBusId, "CUresult (char *, int, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuIpcGetEventHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetEventHandle, "CUresult (CUipcEventHandle *, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuIpcOpenEventHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenEventHandle, "CUresult (CUevent *, CUipcEventHandle)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuIpcGetMemHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuIpcGetMemHandle, "CUresult (CUipcMemHandle *, CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuIpcOpenMemHandle_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuIpcOpenMemHandle_v2, "CUresult (CUdeviceptr *, CUipcMemHandle, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuIpcCloseMemHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuIpcCloseMemHandle, "CUresult (CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemHostRegister_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostRegister_v2, "CUresult (void *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemHostUnregister", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostUnregister, "CUresult (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyPeer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeer, "CUresult (CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyPeerAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyPeerAsync, "CUresult (CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemsetD8_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8_v2, "CUresult (CUdeviceptr, unsigned char, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemsetD2D8_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8_v2, "CUresult (CUdeviceptr, size_t, unsigned char, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemsetD8Async", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8Async, "CUresult (CUdeviceptr, unsigned char, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemsetD2D8Async", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8Async, "CUresult (CUdeviceptr, size_t, unsigned char, size_t, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuArrayGetSparseProperties", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetSparseProperties, "CUresult (CUDA_ARRAY_SPARSE_PROPERTIES *, CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMipmappedArrayGetSparseProperties", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetSparseProperties, "CUresult (CUDA_ARRAY_SPARSE_PROPERTIES *, CUmipmappedArray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuArrayGetMemoryRequirements", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetMemoryRequirements, "CUresult (CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUarray, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMipmappedArrayGetMemoryRequirements", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetMemoryRequirements, "CUresult (CUDA_ARRAY_MEMORY_REQUIREMENTS *, CUmipmappedArray, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuArrayGetPlane", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayGetPlane, "CUresult (CUarray *, CUarray, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuArrayDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArrayDestroy, "CUresult (CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuArray3DGetDescriptor_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2, "CUresult (CUDA_ARRAY3D_DESCRIPTOR *, CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMipmappedArrayGetLevel", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel, "CUresult (CUarray *, CUmipmappedArray, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMipmappedArrayDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayDestroy, "CUresult (CUmipmappedArray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemFreeAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemFreeAsync, "CUresult (CUdeviceptr, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAllocAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocAsync, "CUresult (CUdeviceptr *, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolTrimTo", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolTrimTo, "CUresult (CUmemoryPool, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAttribute, "CUresult (CUmemoryPool, CUmemPool_attribute, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAttribute, "CUresult (CUmemoryPool, CUmemPool_attribute, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolSetAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolSetAccess, "CUresult (CUmemoryPool, CUmemAccessDesc const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolGetAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolGetAccess, "CUresult (CUmemAccess_flags *, CUmemoryPool, CUmemLocation *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolCreate, "CUresult (CUmemoryPool *, CUmemPoolProps const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolDestroy, "CUresult (CUmemoryPool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAllocFromPoolAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocFromPoolAsync, "CUresult (CUdeviceptr *, size_t, CUmemoryPool, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolExportToShareableHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportToShareableHandle, "CUresult (void *, CUmemoryPool, CUmemAllocationHandleType, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolImportFromShareableHandle", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportFromShareableHandle, "CUresult (CUmemoryPool *, void *, CUmemAllocationHandleType, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolExportPointer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolExportPointer, "CUresult (CUmemPoolPtrExportData *, CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPoolImportPointer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPoolImportPointer, "CUresult (CUdeviceptr *, CUmemoryPool, CUmemPoolPtrExportData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPrefetchAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync, "CUresult (CUdeviceptr, size_t, CUdevice, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemPrefetchAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemPrefetchAsync_v2, "CUresult (CUdeviceptr, size_t, CUmemLocation, unsigned int, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAdvise", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise, "CUresult (CUdeviceptr, size_t, CUmem_advise, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAdvise_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAdvise_v2, "CUresult (CUdeviceptr, size_t, CUmem_advise, CUmemLocation)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemRangeGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttribute, "CUresult (void *, size_t, CUmem_range_attribute, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemRangeGetAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemRangeGetAttributes, "CUresult (void **, size_t *, CUmem_range_attribute *, size_t, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuPointerGetAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuPointerGetAttributes, "CUresult (unsigned int, CUpointer_attribute *, void **, CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreate, "CUresult (CUstream *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamCreateWithPriority", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCreateWithPriority, "CUresult (CUstream *, unsigned int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetPriority", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetPriority, "CUresult (CUstream, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetFlags, "CUresult (CUstream, unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetId", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetId, "CUresult (CUstream, unsigned PY_LONG_LONG *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamWaitEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamWaitEvent, "CUresult (CUstream, CUevent, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamBeginCapture_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamBeginCapture_v2, "CUresult (CUstream, CUstreamCaptureMode)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuThreadExchangeStreamCaptureMode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuThreadExchangeStreamCaptureMode, "CUresult (CUstreamCaptureMode *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamEndCapture", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamEndCapture, "CUresult (CUstream, CUgraph *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamIsCapturing", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamIsCapturing, "CUresult (CUstream, CUstreamCaptureStatus *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamUpdateCaptureDependencies", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamUpdateCaptureDependencies, "CUresult (CUstream, CUgraphNode *, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamAttachMemAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamAttachMemAsync, "CUresult (CUstream, CUdeviceptr, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamQuery", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamQuery, "CUresult (CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamSynchronize", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSynchronize, "CUresult (CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamDestroy_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamDestroy_v2, "CUresult (CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamCopyAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamCopyAttributes, "CUresult (CUstream, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetAttribute, "CUresult (CUstream, CUstreamAttrID, CUstreamAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamSetAttribute, "CUresult (CUstream, CUstreamAttrID, CUstreamAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreate, "CUresult (CUevent *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventRecord", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventRecord, "CUresult (CUevent, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventRecordWithFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventRecordWithFlags, "CUresult (CUevent, CUstream, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventQuery", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventQuery, "CUresult (CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventSynchronize", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventSynchronize, "CUresult (CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventDestroy_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventDestroy_v2, "CUresult (CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventElapsedTime", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventElapsedTime, "CUresult (float *, CUevent, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuImportExternalMemory", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalMemory, "CUresult (CUexternalMemory *, CUDA_EXTERNAL_MEMORY_HANDLE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuExternalMemoryGetMappedBuffer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedBuffer, "CUresult (CUdeviceptr *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_BUFFER_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuExternalMemoryGetMappedMipmappedArray", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuExternalMemoryGetMappedMipmappedArray, "CUresult (CUmipmappedArray *, CUexternalMemory, CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDestroyExternalMemory", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalMemory, "CUresult (CUexternalMemory)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuImportExternalSemaphore", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuImportExternalSemaphore, "CUresult (CUexternalSemaphore *, CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuSignalExternalSemaphoresAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSignalExternalSemaphoresAsync, "CUresult (CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS const *, unsigned int, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuWaitExternalSemaphoresAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuWaitExternalSemaphoresAsync, "CUresult (CUexternalSemaphore const *, CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS const *, unsigned int, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDestroyExternalSemaphore", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDestroyExternalSemaphore, "CUresult (CUexternalSemaphore)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuFuncGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFuncGetAttribute, "CUresult (int *, CUfunction_attribute, CUfunction)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuFuncSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetAttribute, "CUresult (CUfunction, CUfunction_attribute, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuFuncSetCacheConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetCacheConfig, "CUresult (CUfunction, CUfunc_cache)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuFuncSetSharedMemConfig", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuFuncSetSharedMemConfig, "CUresult (CUfunction, CUsharedconfig)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuLaunchHostFunc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuLaunchHostFunc, "CUresult (CUstream, CUhostFn, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphCreate, "CUresult (CUgraph *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddKernelNode_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddKernelNode_v2, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_KERNEL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphKernelNodeGetParams_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetParams_v2, "CUresult (CUgraphNode, CUDA_KERNEL_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphKernelNodeSetParams_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetParams_v2, "CUresult (CUgraphNode, CUDA_KERNEL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddMemcpyNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemcpyNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMCPY3D const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemcpyNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeGetParams, "CUresult (CUgraphNode, CUDA_MEMCPY3D *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemcpyNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemcpyNodeSetParams, "CUresult (CUgraphNode, CUDA_MEMCPY3D const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddMemsetNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemsetNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEMSET_NODE_PARAMS const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemsetNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeGetParams, "CUresult (CUgraphNode, CUDA_MEMSET_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemsetNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemsetNodeSetParams, "CUresult (CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddHostNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddHostNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_HOST_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphHostNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeGetParams, "CUresult (CUgraphNode, CUDA_HOST_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphHostNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphHostNodeSetParams, "CUresult (CUgraphNode, CUDA_HOST_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddChildGraphNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddChildGraphNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUgraph)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphChildGraphNodeGetGraph", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphChildGraphNodeGetGraph, "CUresult (CUgraphNode, CUgraph *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddEmptyNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEmptyNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddEventRecordNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventRecordNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphEventRecordNodeGetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeGetEvent, "CUresult (CUgraphNode, CUevent *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphEventRecordNodeSetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventRecordNodeSetEvent, "CUresult (CUgraphNode, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddEventWaitNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddEventWaitNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphEventWaitNodeGetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeGetEvent, "CUresult (CUgraphNode, CUevent *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphEventWaitNodeSetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphEventWaitNodeSetEvent, "CUresult (CUgraphNode, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddExternalSemaphoresSignalNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresSignalNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExternalSemaphoresSignalNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeGetParams, "CUresult (CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExternalSemaphoresSignalNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresSignalNodeSetParams, "CUresult (CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddExternalSemaphoresWaitNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddExternalSemaphoresWaitNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExternalSemaphoresWaitNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeGetParams, "CUresult (CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExternalSemaphoresWaitNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExternalSemaphoresWaitNodeSetParams, "CUresult (CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddMemAllocNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemAllocNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUDA_MEM_ALLOC_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemAllocNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemAllocNodeGetParams, "CUresult (CUgraphNode, CUDA_MEM_ALLOC_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddMemFreeNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddMemFreeNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUdeviceptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphMemFreeNodeGetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphMemFreeNodeGetParams, "CUresult (CUgraphNode, CUdeviceptr *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGraphMemTrim", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGraphMemTrim, "CUresult (CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetGraphMemAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetGraphMemAttribute, "CUresult (CUdevice, CUgraphMem_attribute, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceSetGraphMemAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceSetGraphMemAttribute, "CUresult (CUdevice, CUgraphMem_attribute, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphClone", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphClone, "CUresult (CUgraph *, CUgraph)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeFindInClone", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeFindInClone, "CUresult (CUgraphNode *, CUgraphNode, CUgraph)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeGetType", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetType, "CUresult (CUgraphNode, CUgraphNodeType *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphGetNodes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetNodes, "CUresult (CUgraph, CUgraphNode *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphGetRootNodes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetRootNodes, "CUresult (CUgraph, CUgraphNode *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphGetEdges", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphGetEdges, "CUresult (CUgraph, CUgraphNode *, CUgraphNode *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeGetDependencies", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependencies, "CUresult (CUgraphNode, CUgraphNode *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeGetDependentNodes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetDependentNodes, "CUresult (CUgraphNode, CUgraphNode *, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddDependencies", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddDependencies, "CUresult (CUgraph, CUgraphNode const *, CUgraphNode const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphRemoveDependencies", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphRemoveDependencies, "CUresult (CUgraph, CUgraphNode const *, CUgraphNode const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphDestroyNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroyNode, "CUresult (CUgraphNode)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphInstantiateWithFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithFlags, "CUresult (CUgraphExec *, CUgraph, unsigned PY_LONG_LONG)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphInstantiateWithParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphInstantiateWithParams, "CUresult (CUgraphExec *, CUgraph, CUDA_GRAPH_INSTANTIATE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecGetFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecGetFlags, "CUresult (CUgraphExec, cuuint64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecKernelNodeSetParams_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecKernelNodeSetParams_v2, "CUresult (CUgraphExec, CUgraphNode, CUDA_KERNEL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecMemcpyNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemcpyNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_MEMCPY3D const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecMemsetNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecMemsetNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_MEMSET_NODE_PARAMS const *, CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecHostNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecHostNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_HOST_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecChildGraphNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecChildGraphNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUgraph)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecEventRecordNodeSetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventRecordNodeSetEvent, "CUresult (CUgraphExec, CUgraphNode, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecEventWaitNodeSetEvent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecEventWaitNodeSetEvent, "CUresult (CUgraphExec, CUgraphNode, CUevent)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecExternalSemaphoresSignalNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresSignalNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecExternalSemaphoresWaitNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecExternalSemaphoresWaitNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeSetEnabled", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetEnabled, "CUresult (CUgraphExec, CUgraphNode, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeGetEnabled", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeGetEnabled, "CUresult (CUgraphExec, CUgraphNode, unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphUpload", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphUpload, "CUresult (CUgraphExec, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphLaunch", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphLaunch, "CUresult (CUgraphExec, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecDestroy, "CUresult (CUgraphExec)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDestroy, "CUresult (CUgraph)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecUpdate_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecUpdate_v2, "CUresult (CUgraphExec, CUgraph, CUgraphExecUpdateResultInfo *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphKernelNodeCopyAttributes", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeCopyAttributes, "CUresult (CUgraphNode, CUgraphNode)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphKernelNodeGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeGetAttribute, "CUresult (CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphKernelNodeSetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphKernelNodeSetAttribute, "CUresult (CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphDebugDotPrint", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphDebugDotPrint, "CUresult (CUgraph, char const *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuUserObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectCreate, "CUresult (CUuserObject *, void *, CUhostFn, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuUserObjectRetain", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRetain, "CUresult (CUuserObject, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuUserObjectRelease", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuUserObjectRelease, "CUresult (CUuserObject, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphRetainUserObject", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphRetainUserObject, "CUresult (CUgraph, CUuserObject, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphReleaseUserObject", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphReleaseUserObject, "CUresult (CUgraph, CUuserObject, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphAddNode", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphAddNode, "CUresult (CUgraphNode *, CUgraph, CUgraphNode const *, size_t, CUgraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphNodeSetParams, "CUresult (CUgraphNode, CUgraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphExecNodeSetParams", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphExecNodeSetParams, "CUresult (CUgraphExec, CUgraphNode, CUgraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuOccupancyMaxActiveBlocksPerMultiprocessor", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessor, "CUresult (int *, CUfunction, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, "CUresult (int *, CUfunction, int, size_t, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuOccupancyAvailableDynamicSMemPerBlock", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuOccupancyAvailableDynamicSMemPerBlock, "CUresult (size_t *, CUfunction, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuTexObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectCreate, "CUresult (CUtexObject *, CUDA_RESOURCE_DESC const *, CUDA_TEXTURE_DESC const *, CUDA_RESOURCE_VIEW_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuTexObjectDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectDestroy, "CUresult (CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuTexObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuTexObjectGetTextureDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuTexObjectGetTextureDesc, "CUresult (CUDA_TEXTURE_DESC *, CUtexObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuSurfObjectCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectCreate, "CUresult (CUsurfObject *, CUDA_RESOURCE_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuSurfObjectDestroy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectDestroy, "CUresult (CUsurfObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuSurfObjectGetResourceDesc", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuSurfObjectGetResourceDesc, "CUresult (CUDA_RESOURCE_DESC *, CUsurfObject)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceCanAccessPeer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceCanAccessPeer, "CUresult (int *, CUdevice, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxEnablePeerAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxEnablePeerAccess, "CUresult (CUcontext, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuCtxDisablePeerAccess", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxDisablePeerAccess, "CUresult (CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetP2PAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetP2PAttribute, "CUresult (int *, CUdevice_P2PAttribute, CUdevice, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsUnregisterResource", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnregisterResource, "CUresult (CUgraphicsResource)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsSubResourceGetMappedArray", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsSubResourceGetMappedArray, "CUresult (CUarray *, CUgraphicsResource, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsResourceGetMappedMipmappedArray", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedMipmappedArray, "CUresult (CUmipmappedArray *, CUgraphicsResource)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsResourceGetMappedPointer_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedPointer_v2, "CUresult (CUdeviceptr *, size_t *, CUgraphicsResource)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsResourceSetMapFlags_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceSetMapFlags_v2, "CUresult (CUgraphicsResource, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsMapResources", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsMapResources, "CUresult (unsigned int, CUgraphicsResource *, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsUnmapResources", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsUnmapResources, "CUresult (unsigned int, CUgraphicsResource *, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGetProcAddress_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetProcAddress_v2, "CUresult (char const *, void **, int, cuuint64_t, CUdriverProcAddressQueryResult *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGetExportTable", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGetExportTable, "CUresult (void const **, CUuuid const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuProfilerStart", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStart, "CUresult (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuProfilerStop", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuProfilerStop, "CUresult (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsEGLRegisterImage", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsEGLRegisterImage, "CUresult (CUgraphicsResource *, __pyx_t_4cuda_5ccuda_EGLImageKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamConsumerConnect", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnect, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamConsumerConnectWithFlags", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerConnectWithFlags, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamConsumerDisconnect", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerDisconnect, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamConsumerAcquireFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerAcquireFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, CUgraphicsResource *, CUstream *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamConsumerReleaseFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamConsumerReleaseFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, CUgraphicsResource, CUstream *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamProducerConnect", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerConnect, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_EGLStreamKHR, __pyx_t_4cuda_5ccuda_EGLint, __pyx_t_4cuda_5ccuda_EGLint)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamProducerDisconnect", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerDisconnect, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamProducerPresentFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerPresentFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame, CUstream *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEGLStreamProducerReturnFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEGLStreamProducerReturnFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglStreamConnection *, __pyx_t_4cuda_5ccuda_CUeglFrame *, CUstream *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsResourceGetMappedEglFrame", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsResourceGetMappedEglFrame, "CUresult (__pyx_t_4cuda_5ccuda_CUeglFrame *, CUgraphicsResource, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuEventCreateFromEGLSync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuEventCreateFromEGLSync, "CUresult (CUevent *, __pyx_t_4cuda_5ccuda_EGLSyncKHR, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsGLRegisterBuffer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterBuffer, "CUresult (CUgraphicsResource *, __pyx_t_4cuda_5ccuda_GLuint, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsGLRegisterImage", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsGLRegisterImage, "CUresult (CUgraphicsResource *, __pyx_t_4cuda_5ccuda_GLuint, __pyx_t_4cuda_5ccuda_GLenum, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGLGetDevices_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGLGetDevices_v2, "CUresult (unsigned int *, CUdevice *, unsigned int, __pyx_t_4cuda_5ccuda_CUGLDeviceList)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuVDPAUGetDevice", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuVDPAUGetDevice, "CUresult (CUdevice *, __pyx_t_4cuda_5ccuda_VdpDevice, __pyx_t_4cuda_5ccuda_VdpGetProcAddress *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsVDPAURegisterVideoSurface", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterVideoSurface, "CUresult (CUgraphicsResource *, __pyx_t_4cuda_5ccuda_VdpVideoSurface, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuGraphicsVDPAURegisterOutputSurface", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuGraphicsVDPAURegisterOutputSurface, "CUresult (CUgraphicsResource *, __pyx_t_4cuda_5ccuda_VdpOutputSurface, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cuda._lib.ccudart.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "initPrimaryContext", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext, "cudaError_t (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "resetPrimaryContext", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext, "cudaError_t (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__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_3_0_7(__pyx_t_1, "_setLastError", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError, "cudaError_t (cudaError_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getDescInfo", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo, "cudaError_t (struct cudaChannelFormatDesc const *, int *, CUarray_format *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "streamAddCallbackCommon", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon, "cudaError_t (cudaStream_t, cudaStreamCallback_t, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "streamGetCaptureInfoCommon", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getChannelFormatDescFromDriverDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc, "cudaError_t (struct cudaChannelFormatDesc *, size_t *, size_t *, size_t *, CUDA_ARRAY3D_DESCRIPTOR_v2 const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getChannelDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc, "cudaError_t (cudaArray_const_t, struct cudaChannelFormatDesc *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getDriverResDescFromResDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc, "cudaError_t (CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *, CUDA_TEXTURE_DESC *, struct cudaTextureDesc const *, CUDA_RESOURCE_VIEW_DESC *, struct cudaResourceViewDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getResDescFromDriverResDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc, "cudaError_t (struct cudaResourceDesc *, CUDA_RESOURCE_DESC const *, struct cudaTextureDesc *, CUDA_TEXTURE_DESC const *, struct cudaResourceViewDesc *, CUDA_RESOURCE_VIEW_DESC const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "copy1DConvertTo3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverMemsetNodeParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams, "void (struct cudaMemsetParams const *, CUDA_MEMSET_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverMemCopy3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams, "cudaError_t (struct cudaMemcpy3DParms const *, CUDA_MEMCPY3D *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "mallocArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray, "cudaError_t (cudaArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpy2DToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray, "cudaError_t (cudaArray_t, size_t, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpyDispatch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "mallocHost", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost, "cudaError_t (size_t, void **, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "mallocPitch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch, "cudaError_t (size_t, size_t, size_t, void **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "mallocMipmappedArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray, "cudaError_t (cudaMipmappedArray_t *, struct cudaChannelFormatDesc const *, size_t, size_t, size_t, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpy2DPtr", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr, "cudaError_t (char *, size_t, char const *, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpy3D", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D, "cudaError_t (struct cudaMemcpy3DParms const *, bool, int, int, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpyAsyncDispatch", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch, "cudaError_t (void *, void const *, size_t, enum cudaMemcpyKind, cudaStream_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toCudartMemCopy3DParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams, "cudaError_t (CUDA_MEMCPY3D_v2 const *, struct cudaMemcpy3DParms *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpy2DFromArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray, "cudaError_t (char *, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpy2DArrayToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memset3DPtr", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr, "cudaError_t (struct cudaPitchedPtr, int, struct cudaExtent, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpyToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray, "cudaError_t (cudaArray_t, size_t, size_t, char const *, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpyFromArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray, "cudaError_t (char *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "memcpyArrayToArray", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray, "cudaError_t (cudaArray_t, size_t, size_t, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverCudaResourceDesc", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc, "cudaError_t (CUDA_RESOURCE_DESC *, struct cudaResourceDesc const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getDriverEglFrame", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame, "cudaError_t (__pyx_t_4cuda_5ccuda_CUeglFrame *, __pyx_t_4cuda_7ccudart_cudaEglFrame)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "getRuntimeEglFrame", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame, "cudaError_t (__pyx_t_4cuda_7ccudart_cudaEglFrame *, __pyx_t_4cuda_5ccuda_CUeglFrame)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverGraphNodeParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams, "cudaError_t (struct cudaGraphNodeParams const *, CUgraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toCudartGraphNodeOutParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams, "void (CUgraphNodeParams const *, struct cudaGraphNodeParams *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverKernelNodeParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams, "cudaError_t (struct cudaKernelNodeParams const *, CUDA_KERNEL_NODE_PARAMS *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "toDriverHostNodeParams", (void (**)(void))&__pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams, "void (struct cudaHostNodeParams const *, CUDA_HOST_NODE_PARAMS *)") < 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;
}


#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

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "ccudart",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* 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
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#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;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
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)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    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
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = 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
  /*--- 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);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "ccudart" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #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(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 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(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 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
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  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) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cuda/_lib/ccudart/ccudart.pyx":1
 * # Copyright 2021-2023 NVIDIA Corporation.  All rights reserved.             # <<<<<<<<<<<<<<
 * #
 * # Please refer to the NVIDIA end user license agreement (EULA) associated
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_TraceReturn(Py_None, 0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init cuda._lib.ccudart.ccudart", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } 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
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- 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

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    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++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        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;
}

/* 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

/* ErrOccurredWithGIL */
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;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_0_7
#define __PYX_HAVE_RT_ImportType_3_0_7
static PyTypeObject *__Pyx_ImportType_3_0_7(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_7 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_7 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_7 && (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(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    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(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    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_GetAttrStrNoError(__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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
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,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* 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;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* 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
            if (unlikely(__Pyx_PyLong_IsNeg(x))) {
                goto raise_neg_overflow;
            } else if (__Pyx_PyLong_IsCompact(x)) {
                __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
            } else {
                const digit* digits = __Pyx_PyLong_Digits(x);
                assert(__Pyx_PyLong_DigitCount(x) > 1);
                switch (__Pyx_PyLong_DigitCount(x)) {
                    case 2:
                        if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                                return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                                return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                                return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                            }
                        }
                        break;
                }
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
            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
            if (__Pyx_PyLong_IsCompact(x)) {
                __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
            } else {
                const digit* digits = __Pyx_PyLong_Digits(x);
                assert(__Pyx_PyLong_DigitCount(x) > 1);
                switch (__Pyx_PyLong_SignedDigitCount(x)) {
                    case -2:
                        if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                                return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                    case 2:
                        if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                                return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                    case -3:
                        if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                                return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                                return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                    case -4:
                        if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                                return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                                return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                            }
                        }
                        break;
                }
            }
#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
            }
        }
        {
            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 ret = -1;
#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                ret = _PyLong_AsByteArray((PyLongObject *)v,
                                           bytes, sizeof(val),
                                           is_little, !is_unsigned);
#else
                PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
                int bits, remaining_bits, is_negative = 0;
                long idigit;
                int chunk_size = (sizeof(long) < 8) ? 30 : 62;
                if (unlikely(!PyLong_CheckExact(v))) {
                    PyObject *tmp = v;
                    v = PyNumber_Long(v);
                    assert(PyLong_CheckExact(v));
                    Py_DECREF(tmp);
                    if (unlikely(!v)) return (int) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (int) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (int) -1;
                    is_negative = result == 1;
                }
#endif
                if (is_unsigned && unlikely(is_negative)) {
                    goto raise_neg_overflow;
                } else if (is_negative) {
                    stepval = PyNumber_Invert(v);
                    if (unlikely(!stepval))
                        return (int) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                val = (int) 0;
                mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
                shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
                for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
                    PyObject *tmp, *digit;
                    digit = PyNumber_And(stepval, mask);
                    if (unlikely(!digit)) goto done;
                    idigit = PyLong_AsLong(digit);
                    Py_DECREF(digit);
                    if (unlikely(idigit < 0)) goto done;
                    tmp = PyNumber_Rshift(stepval, shift);
                    if (unlikely(!tmp)) goto done;
                    Py_DECREF(stepval); stepval = tmp;
                    val |= ((int) idigit) << bits;
                    #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                    if (Py_SIZE(stepval) == 0)
                        goto unpacking_done;
                    #endif
                }
                idigit = PyLong_AsLong(stepval);
                if (unlikely(idigit < 0)) goto done;
                remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
                if (unlikely(idigit >= (1L << remaining_bits)))
                    goto raise_overflow;
                val |= ((int) idigit) << bits;
            #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                if (!is_unsigned) {
                    if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                        goto raise_overflow;
                    if (is_negative)
                        val = ~val;
                }
                ret = 0;
            done:
                Py_XDECREF(shift);
                Py_XDECREF(mask);
                Py_XDECREF(stepval);
#endif
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
            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;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
#else
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s_);
    }
    return name;
}
#endif

/* 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;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* 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
            if (unlikely(__Pyx_PyLong_IsNeg(x))) {
                goto raise_neg_overflow;
            } else if (__Pyx_PyLong_IsCompact(x)) {
                __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
            } else {
                const digit* digits = __Pyx_PyLong_Digits(x);
                assert(__Pyx_PyLong_DigitCount(x) > 1);
                switch (__Pyx_PyLong_DigitCount(x)) {
                    case 2:
                        if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                                return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                                return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                                return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                            }
                        }
                        break;
                }
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
            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
            if (__Pyx_PyLong_IsCompact(x)) {
                __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
            } else {
                const digit* digits = __Pyx_PyLong_Digits(x);
                assert(__Pyx_PyLong_DigitCount(x) > 1);
                switch (__Pyx_PyLong_SignedDigitCount(x)) {
                    case -2:
                        if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                                return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                    case 2:
                        if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                                return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                    case -3:
                        if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                                return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                                return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                    case -4:
                        if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                                return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                                return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                            }
                        }
                        break;
                }
            }
#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
            }
        }
        {
            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 ret = -1;
#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                ret = _PyLong_AsByteArray((PyLongObject *)v,
                                           bytes, sizeof(val),
                                           is_little, !is_unsigned);
#else
                PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
                int bits, remaining_bits, is_negative = 0;
                long idigit;
                int chunk_size = (sizeof(long) < 8) ? 30 : 62;
                if (unlikely(!PyLong_CheckExact(v))) {
                    PyObject *tmp = v;
                    v = PyNumber_Long(v);
                    assert(PyLong_CheckExact(v));
                    Py_DECREF(tmp);
                    if (unlikely(!v)) return (long) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (long) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (long) -1;
                    is_negative = result == 1;
                }
#endif
                if (is_unsigned && unlikely(is_negative)) {
                    goto raise_neg_overflow;
                } else if (is_negative) {
                    stepval = PyNumber_Invert(v);
                    if (unlikely(!stepval))
                        return (long) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                val = (long) 0;
                mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
                shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
                for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
                    PyObject *tmp, *digit;
                    digit = PyNumber_And(stepval, mask);
                    if (unlikely(!digit)) goto done;
                    idigit = PyLong_AsLong(digit);
                    Py_DECREF(digit);
                    if (unlikely(idigit < 0)) goto done;
                    tmp = PyNumber_Rshift(stepval, shift);
                    if (unlikely(!tmp)) goto done;
                    Py_DECREF(stepval); stepval = tmp;
                    val |= ((long) idigit) << bits;
                    #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                    if (Py_SIZE(stepval) == 0)
                        goto unpacking_done;
                    #endif
                }
                idigit = PyLong_AsLong(stepval);
                if (unlikely(idigit < 0)) goto done;
                remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
                if (unlikely(idigit >= (1L << remaining_bits)))
                    goto raise_overflow;
                val |= ((long) idigit) << bits;
            #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                if (!is_unsigned) {
                    if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                        goto raise_overflow;
                    if (is_negative)
                        val = ~val;
                }
                ret = 0;
            done:
                Py_XDECREF(shift);
                Py_XDECREF(mask);
                Py_XDECREF(stepval);
#endif
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
            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 = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#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) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#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 unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* 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;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    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_3_0_7
#define __PYX_HAVE_RT_ImportFunction_3_0_7
static int __Pyx_ImportFunction_3_0_7(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 (!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);
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
#if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        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);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#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 && !CYTHON_COMPILING_IN_LIMITED_API) || (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) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_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
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #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);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
